Smarty {html_radio}如何使其成为必需品?

时间:2016-04-17 01:01:26

标签: html radio-button smarty prestashop

我正在寻找如何使用智能自定义功能{html_radio} http://www.smarty.net/docs/en/language.function.html.radios.tpl

制作一个单选按钮组

这是我的代码:

{html_radios name='radio' options=$radio_options separator='<br />'}

谢谢。

1 个答案:

答案 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 />'}

它很棒。