$form_widget = new \app\common\widget\FormPro();
0 form_input
两行
'title'=>'名称',
'name'=>'name',
'data'=>'',
'type'=>'text',
'placeholder'=>'',
'readonly'=>'1',20230831新增 如果为空则不设置
'theme'=>1
$form_widget->form_input(['title'=>'名称','name'=>'name','data'=>'','theme'=>1])|raw
一行
'title'=>'名称',
'name'=>'name',
'data'=>'',
'type'=>'text',
'placeholder'=>'',
'readonly'=>'1',20230831新增 如果为空则不设置
'theme'=>1
$form_widget->form_input(['title'=>'名称','name'=>'name','data'=>'','theme'=>2])|raw
1 form_input_tag
需要文件 :
link rel="stylesheet" href="/public/static/zfcms/style/input-tag/inputTag.css" media="all">
两行
'title'=>'名称',
'name'=>'name',
'data'=>'',
'placeholder'=>'',
'theme'=>1
$form_widget->form_input_tag(['title'=>'名称','name'=>'name','data'=>'','theme'=>1])|raw
一行
'title'=>'名称',
'name'=>'name',
'data'=>'',
'placeholder'=>'',
'theme'=>1
$form_widget->form_input_tag(['title'=>'名称','name'=>'name','data'=>'','theme'=>2])|raw
2 form_input_color
两行
'title'=>'名称',
'name'=>'name',
'data'=>'',
'theme'=>1
$form_widget->form_input_color(['title'=>'颜色','name'=>'ctime','data'=>'#ccc','theme'=>1])|raw
一行
'title'=>'名称',
'name'=>'name',
'data'=>'',
'theme'=>1
$form_widget->form_input_color(['title'=>'颜色','name'=>'ctime','data'=>'#ccc','theme'=>2])|raw
3 form_note
顶格
'data'=>'',
'theme'=>1
$form_widget->form_note(['data'=>'这里是内容','theme'=>1])|raw
空格layui-form-item
'data'=>'',
'theme'=>1
$form_widget->form_note(['data'=>'这里是内容','theme'=>2])|raw
空格layui-input-block
'data'=>'',
'theme'=>1
$form_widget->form_note(['data'=>'这里是内容','theme'=>3])|raw
4 form_textarea
两行
'title'=>'名称',
'name'=>'name',
'data'=>'',
'readonly'=>'1',20230831新增 如果为空则不设置
'theme'=>1
$form_widget->form_textarea(['title'=>'名称','name'=>'name','data'=>'','theme'=>1])|raw
一行
'title'=>'名称',
'name'=>'name',
'data'=>'',
'readonly'=>'1',20230831新增 如果为空则不设置
'theme'=>2
$form_widget->form_textarea(['title'=>'名称','name'=>'name','data'=>'','theme'=>2])|raw
5 form_radio
Collapse Title 1
Collapse Title 1
Collapse Title 1
Collapse Title 1
Collapse Title 1
Collapse Title 1
6 layui_switch
Collapse Title 1
Collapse Title 2
7 form_checkbox
$key_list = array_keys($data);
$_temp_list = [];
foreach($key_list as $k=>$vo){
if(strpos($vo,'zf_list_') === 0){
$_temp_list[] = $vo;
}
}
if($_temp_list){
foreach($_temp_list as $k=>$vo){
if(isset($data[$vo]) && is_array($data[$vo])){
$data[explode('zf_list_',$vo)[1]] = implode(",", $data[$vo]);
unset($data[$vo]);
}
}
}
unset($data['temp']);
$checkbox_key_arr = [
'consultation_mode' //自定义CheckBox字段
];
foreach($checkbox_key_arr as $k=>$vo){
if(!isset($data[$vo])){
$data[$vo] = '';
}
}
Collapse Title 1
Collapse Title 2
8 upload_album
Collapse Title 1
9 upload_album_title
Collapse Title 1
10 filesystem_album
Collapse Title 1
11 form_time
Collapse Title 1
Collapse Title 2
12 upload_pic
Collapse Title 1
Collapse Title 1
Collapse Title 1
13 upload_dragpic
Collapse Title 1
Collapse Title 1
Collapse Title 1
Collapse Title 1
14 filesystem_pic
Collapse Title 1
Collapse Title 1
Collapse Title 1
Collapse Title 1
15 upload_file
Collapse Title 1
16 filesystem_file
Collapse Title 1
17 form_select
$form_widget->form_select(['title'=>'分类','name'=>'cid','data'=>$cid,'list_arr'=>$plist,'id_t'=>'cid','theme'=>1])|raw}
18 form_ueditor
script src="/public/static/zfcms/style/ueditor/ueditor.config.js">
script src="/public/static/zfcms/style/ueditor/ueditor.all.js">
link rel="stylesheet" href="/public/static/zfcms/style/ueditor/themes/default/css/ueditor.css" media="all">
Collapse Title 1
19 form_tinymce
20 form_wangeditor
21 form_meditor
22 form_vditor
23 form_input_select
script src="/public/static/zfcms/style/input-select/selectInput.js">
1,2 返回的值是name
3,4 返回的值是value 需要处理 _$name 直接覆盖$name即可 _data是value的值
如果$name=='',则为空 如果$name!='' && $_name!='' 则$name的值为$_name的值
Collapse Title 1
Collapse Title 2
Collapse Title 3
Collapse Title 4