1
$ids = array(1, 2, 3);
$texts = array('a', 'b', 'c');
$attributes = array('a1', 'b1', 'c1');
$smarty->assign('ids', $ids);
$smarty->assign('texts', $texts);
$smarty->assign('attributes', $attributes);
TPL部分
<select name="test">
{html_options values=$ids output=$texts attribute=$attributes}
</select>
結果
<select name="test">
<option value="1">a</option>
<option value="2">b</option>
<option value="3">c</option>
</select>
能否添加更多定義的屬性如何增加更多的屬性?