나는 cakephp에 초보자입니다. existing_question.ctp라는 체크 박스 폼을 생성하고 배열에 저장했습니다. 그러나 print_r을 시도 할 때 어레이가 정말 이상하게 나옵니다. this처럼 나옵니다.CakePHP 3.5 체크 박스 배열
existing_question.ctp는
<?php
/**
* @var \App\View\AppView $this
* @var \App\Model\Entity\Question[]|\Cake\Collection\CollectionInterface
$questions
*/
use Cake\ORM\TableRegistry;
?>
<nav class="large-3 medium-4 columns" id="actions-sidebar">
<ul class="side-nav">
<li class="heading"><?= __('Actions') ?></li>
<li><?= $this->Html->link(__('Courses'), ['controller' => 'Courses',
'action' => 'index']) ?></li>
</ul>
</nav>
</nav>
<div class="questions form large-9 medium-8 columns content">
<fieldset>
<legend><?= __('Add Question') ?></legend>
<table cellpadding="0" cellspacing="0">
<thead>
<tr>
<th scope="col"><?= $this->Paginator->sort('checked') ?></th>
<th scope="col"><?= $this->Paginator->sort('id') ?></th>
<th scope="col"><?= $this->Paginator->sort('question') ?></th>
<th scope="col"><?= $this->Paginator->sort('marks') ?></th>
</tr>
</thead>
<tbody>
<?php echo $this->Form->create($question) ?>
<?php foreach ($questions as $question): ?>
<tr>
<td><?= $this->Form->checkbox('id[].', array('value' =>
$question['id'], 'name' => 'Question[id][]', 'checked'=>false))?></td>
<td><?= $this->Number->format($question->id) ?></td>
<td><?= h($question->question) ?></td>
<td><?= $this->Number->format($question->marks) ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<input type="submit" value="Save">
</form>
<div class="paginator">
<ul class="pagination">
<?= $this->Paginator->first('<< ' . __('first')) ?>
<?= $this->Paginator->prev('< ' . __('previous')) ?>
<?= $this->Paginator->numbers() ?>
<?= $this->Paginator->next(__('next') . ' >') ?>
<?= $this->Paginator->last(__('last') . ' >>') ?>
</ul>
<p><?= $this->Paginator->counter(['format' => __('Page {{page}} of {{pages}}, showing {{current}} record(s) out of {{count}} total')]) ?></p>
<?php //$this->Form->button(__('Submit'), ['action' => 'existingQuestion'])
$this->Form->submit('Save');
// $this->Form->end() ?>
</div>
</fieldset>
나는 많은 튜토리얼을 시도했지만이해야처럼이 나던 나온다. 누구든지 나를 도울 수 있습니까 ??? 편집을 할
: 내가 그것을 모두의 this
모양을
을 :
이
은 false로 '에 HiddenField'을 설정하여 비활성화 할 수 있습니다? – shahonseven게시물을 편집했습니다 –