【发布时间】:2014-03-18 07:28:33
【问题描述】:
我是 cakephp 新手。我想从复选框中删除多条记录,但我不知道如何使用它。下面是我发布的代码,但不是复选框值。
<?php echo $this->Form-enter code here>create(array('action' => 'deleteall'));?>
<?php echo $this->Html->Link('Delete',array('action' => 'deleteall'),array('confirm' => 'Are you sure you want to delete selected record?'));?>
<div class="row">
<?php echo $this->Session->flash();?>
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-heading">Subjects</div>
<div class="table-responsive">
<table class="table">
<tr>
<th><?php echo $this->Form->input('checkbox', array('type' => 'checkbox','name'=>'selectAll','label'=>false,'id'=>'selectAll','hiddenField'=>false));?></td>
<th>S.No.</td>
<th>Subject Name</td>
<th>Action</td>
<th>Question Bank Account</td>
</tr>
<?php foreach ($subject as $post): ?>
<tr>
<td><?php echo $this->Form->checkbox('subject',array('value' => $post['Subject']['subject_id'],'name' => "data['Subject']['subject_id'][]",));?></td>
<td><?php echo $post['Subject']['subject_id']; ?></td>
<td><?php echo $post['Subject']['subject_name']; ?></td>
<td><a data-toggle="modal" data-href="<?php echo $this->Html->url(array('action'=>'edit', $post['Subject']['subject_id']));?>"><span class="glyphicon glyphicon-pencil"></span> Edit</a></td>
<td><?php echo $post['Subject']['subject_id']; ?></td>
</tr>
<?php endforeach; ?>
<?php unset($post); ?>
</table>
</div>
</div>
</div>
</div>
<?php
echo $this->Form->end();?>
【问题讨论】:
标签: cakephp