原来并不需要用单独的隐藏域来传递的。只要在
程式碼:
<table border = 1 >
<tr>
<th style=20%>选择</th>
<th style=20% >标题</th>
<th style=20%>游客</th>
<th style=40%>ip</th>
</tr>
{foreach from=$allTest item=test}
<tr>
<td > <input type="checkbox" class="checkbox" name="id[]" value="{$test->getId()}" /> </td>
<td > {$test->getTitle()} </td>
<td > {$test->getAuthor()} </td>
<td > {$test->getClientip()} </td>
</tr>
{/foreach}
<tr>
<td > <input class="checkbox" type="checkbox"
name="all" id="all" value="1" onclick="CheckAll('listtest');" /> </td>
程式碼:
$id = $this->_request->getValue("id");
foreach ($id as $key){
var_dump("$key");
$tests= new tests();
$tests->deleteTestById($key);
}
程式碼:
delet
from table in id =(1,2,3,4)