开发者

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>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜