Add more output smarty html option
{html_options values=$ro开发者_如何学Pythonw.milestone_id output=$row.title output=$row.title}
hi folks,how to add more $output in smarty html option ?
The output needs to be an array to populate the dropdown. See the example
PHP code
$smarty->assign('myOptions', array(
1800 => 'Joe Schmoe',
9904 => 'Jack Smith',
2003 => 'Charlie Brown')
);
$smarty->assign('mySelect', 9904);
Then the template
{html_options name=foo options=$myOptions selected=$mySelect}
And the output
<select name="foo">
<option label="Joe Schmoe" value="1800">Joe Schmoe</option>
<option label="Jack Smith" value="9904" selected="selected">Jack Smith</option>
<option label="Charlie Brown" value="2003">Charlie Brown</option>
</select>
精彩评论