我想從視圖模塊中的表格中獲取複選框,但我無法使其工作。這裏的表:
<form action="" method="post">
<TABLE id="dt_basic" class="table table-striped table-bordered table-hover dataTable">
<THEAD>
<TR>
<TH></TH>
<TH>ID</TH>
<TH>Client</TH>
<TH>User</TH>
<TH>Role</TH>
<TH>Projects</TH>
</TR>
</THEAD>
<TBODY>
<?php
/* @var $item Admin\Model\User */
foreach ($this->users as $item) {
?>
<TR>
<TD class='admin'><input type="checkbox" name="users[]" value="<?php echo $item->id; ?>" class="users" checked/></TD>
<TD class='admin c'><?= $item->id ?></TD>
<TD class='admin'><?= $item->getClientObject() ?></TD>
<TD class='admin'>
<img src="<?= $item->getAvatarPath() ?>" alt="me" class="online avatar"/>
<a title='details'
href='/admin/user/detail/id/<?= $item->id ?>'><?= $item->name . " " . $item->surname ?> </a>
</TD>
<TD class='admin'><?= $item->getRoleObject() ?></TD>
<TD class='admin'>
<a title='projects' class='btn btn-default btn-sm'
href='/admin/user/project/id/<?= $item->id ?>'><i
class='fa fa-icon-fix fa-briefcase'></i></a>
<?
foreach ($this->projects[$item->id] as $i => $project) {
echo $project->getName();
if ($i != sizeof($this->projects[$item->id]) - 1)
echo " • ";
}
?>
</TD>
</TR>
<?php
}
?>
</TBODY>
</TABLE>
</form>
我想要得到的users[]
陣列和使用控制器裏面的元素,但我不能找到一個方法來得到它,有什麼建議?
的各個領域給予不同的獨特的名稱。 –