方法:
~~~
tpl_form_option($name, $title, $value = [], $help_text = '', $type = 'text', $attr = [], $extra_class = 'layui-input', $extra_attr = [], $extra_css = [])
~~~
参数描述:
| 参数 | 名称 | 变量类型 |
| --- | --- | --- |
| name | 表单name值 | string |
| title | 表单描述 | string |
| value | 默认值 | array |
| default | 默认值 | string |
| help\_text | 帮助文本 | string |
| extra\_attr | 额外属性 | string |
| type | 类型,默认text,参考[html5](https://ihavenolimitations.xyz/onegow_/onegowcms/%5B%E9%93%BE%E6%8E%A5%5D(http://www.w3school.com.cn/html5/html_5_form_input_types.asp)) | string |
| extra\_class | 属性 | string |
| extra\_css | 额外css | string |
| attr | 属性,详见下表 | array |
代码示例:
~~~
<?php echo tpl_form_option('aaa','哈哈大笑',['温州' => 0,'厦门' => 0,'福州'=>1,'杭州'=>0]); ?>
~~~
效果图:
