方法:
~~~
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](http://www.hmoore.net/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]); ?>
~~~
效果圖:
