我正在寻找如何使用智能自定义功能{html_radio} http://www.smarty.net/docs/en/language.function.html.radios.tpl
制作一个单选按钮组这是我的代码:
{html_radios name='radio' options=$radio_options separator='<br />'}
谢谢。
答案 0 :(得分:0)
从tools / smarty /挖掘到function.html_radios.php并查看$ extra var。
if (!is_array($_val)) {
$extra .= ' ' . $_key . '="' . smarty_function_escape_special_chars($_val) . '"';
}
此外,在http://www.smarty.net/docs/en/language.function.html.radios.tpl中,请参阅&#34; strict&#34;属性。
所以,我的代码如下:
{html_radios required='required' name='radio' options=$radio_options separator='<br />'}
它很棒。