CHtml::checkBoxList 中的附加值是否有解决方案?
现在我这样做:
<?php
echo CHtml::checkBoxList(
'tinyList',
'',
array("value1" => "label1", "value2" => "label2", "value3" => "label3"),
array(
'template' => '<tr><td><img src="{imagePath}" /></td><td>{label}</td><td>{quantity}</td><td>{input}</td></tr>',
'container' => 'tbody'
));
?>
我得到了这个结果:
<tbody id="tinyList">
<tr>
<td><img src="{imagePath}" /></td>
<td><label for="tinyList_0">label1</label></td>
<td>{quantity}</td>
<td><input value="value1" id="tinyList_0" type="checkbox" name="tinyList[]" /></td>
</tr>
<tr>
<td><img src="{imagePath}" /></td>
<td><label for="tinyList_1">label2</label></td>
<td>{quantity}</td>
<td><input value="value2" id="tinyList_1" type="checkbox" name="tinyList[]" /></td>
</tr>
<tr>
<td><img src="{imagePath}" /></td>
<td><label for="tinyList_2">label3</label></td>
<td>{quantity}</td>
<td><input value="value3" id="tinyList_2" type="checkbox" name="tinyList[]" /></td>
</tr>
</tbody>
(如何)我可以填写缺失的部分“imagePath”和“quantity”吗?