组件参考使用

$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
$form_widget->form_radio(['title'=>'状态','name'=>'status','data'=>1,'theme'=>1])|raw
状态
Collapse Title 1
$form_widget->form_radio(['title'=>'状态','name'=>'status','data'=>1,'theme'=>2])|raw
Collapse Title 1
$form_widget->form_radio(['title'=>'状态','name'=>'status','data'=>1,'theme'=>3])|raw
状态
Collapse Title 1
$form_widget->form_radio(['title'=>'状态','name'=>'status','data'=>1,'theme'=>4])|raw
Collapse Title 1
$form_widget->form_radio(['title'=>'状态','name'=>'status','data'=>1,'theme'=>5])|raw
状态
Collapse Title 1
$form_widget->form_radio(['title'=>'状态','name'=>'status','data'=>1,'theme'=>6])|raw



6 layui_switch
Collapse Title 1
$form_widget->layui_switch(['title'=>'名称','name'=>'name','data'=>'','theme'=>1])|raw
名称
Collapse Title 2
$form_widget->layui_switch(['title'=>'名称','name'=>'name','data'=>'','theme'=>2])|raw



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
$form_widget->form_checkbox(['title'=>'名称','name'=>'name','data'=>'','list_arr'=>[['id'=>'1','name'=>'参数1'],['id'=>2,'name'=>'参数2']],'theme'=>1])|raw
名称
Collapse Title 2
$form_widget->form_checkbox(['title'=>'名称','name'=>'name','data'=>'','list_arr'=>[['id'=>'1','name'=>'参数1'],['id'=>2,'name'=>'参数2']],'theme'=>2])|raw



8 upload_album
Collapse Title 1
$form_widget->upload_album(['title'=>'图集','name'=>'album','data'=>'','theme'=>1])|raw
图集
预览图:



9 upload_album_title
Collapse Title 1
$form_widget->upload_album_title(['title'=>'图集_标题','name'=>'album','data'=>'','theme'=>1])|raw
图集_标题
预览图:



10 filesystem_album
Collapse Title 1
$form_widget->filesystem_album(['title'=>'图集','name'=>'album','data'=>'','theme'=>1])|raw
图集
预览图:



11 form_time
Collapse Title 1
$form_widget->form_time(['title'=>'时间','name'=>'ctime','data'=>date("Y-m-d H:i:s",time()),'time_type'=>'datetime','theme'=>1])|raw
时间
Collapse Title 2
$form_widget->form_time(['title'=>'时间','name'=>'ctime','data'=>date("Y-m-d H:i:s",time()),'time_type'=>'datetime','theme'=>2])|raw



12 upload_pic
Collapse Title 1
$form_widget->upload_pic(['title'=>'上传','name'=>'pic','data'=>'','theme'=>1])|raw
上传

Collapse Title 1
$form_widget->upload_pic(['title'=>'上传','name'=>'pic','data'=>'','theme'=>2])|raw
上传
Collapse Title 1
$form_widget->upload_pic(['title'=>'上传','name'=>'pic','data'=>'','theme'=>3])|raw




13 upload_dragpic
Collapse Title 1
$form_widget->upload_dragpic(['title'=>'上传','name'=>'pic','data'=>'','theme'=>1])|raw
上传
点击上传,或将文件拖拽到此处

Collapse Title 1
$form_widget->upload_dragpic(['title'=>'上传','name'=>'pic','data'=>'','theme'=>2])|raw
上传
点击上传,或将文件拖拽到此处

Collapse Title 1
$form_widget->upload_dragpic(['title'=>'上传','name'=>'pic','data'=>'','theme'=>3])|raw
点击上传,或将文件拖拽到此处

Collapse Title 1
$form_widget->upload_dragpic(['title'=>'上传','name'=>'pic','data'=>'','theme'=>4])|raw
点击上传,或将文件拖拽到此处




14 filesystem_pic
Collapse Title 1
$form_widget->filesystem_pic(['title'=>'上传','name'=>'pic','data'=>'','theme'=>1])|raw
上传

Collapse Title 1
$form_widget->filesystem_pic(['title'=>'上传','name'=>'pic','data'=>'','theme'=>2])|raw
上传
Collapse Title 1
$form_widget->filesystem_pic(['title'=>'上传','name'=>'pic','data'=>'','theme'=>3])|raw

Collapse Title 1
$form_widget->filesystem_pic(['title'=>'上传','name'=>'pic','data'=>'','theme'=>4])|raw



15 upload_file
Collapse Title 1
$form_widget->upload_file(['title'=>'上传文件','name'=>'pic','data'=>'','theme'=>1])|raw
上传文件
上传文件



16 filesystem_file
Collapse Title 1
$form_widget->filesystem_file(['title'=>'文件','name'=>'file','data'=>'','theme'=>1])|raw
文件



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
$form_widget->form_ueditor(['title'=>'内容详情','name'=>'content','data'=>'','theme'=>1])|raw}



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
$form_widget->form_input_select(['title'=>'input选择','name'=>'append','data'=>'A','list_arr'=> [['name'=>'AA','value'=>'1'],['name'=>'BB','value'=>'2'],['name'=>'A','value'=>'3'],['name'=>'CC','value'=>'4']],'url'=>'/test_inputselect_json','theme'=>1])|raw
input选择
Collapse Title 2
$form_widget->form_input_select(['title'=>'input选择','name'=>'append','data'=>'A','list_arr'=> [['name'=>'AA','value'=>'1'],['name'=>'BB','value'=>'2'],['name'=>'A','value'=>'3'],['name'=>'CC','value'=>'4']],'url'=>'/test_inputselect_json','theme'=>2])|raw
Collapse Title 3
$form_widget->form_input_select(['title'=>'input选择','name'=>'append','data'=>'A','_data'=>3,'list_arr'=> [['name'=>'AA','value'=>'1'],['name'=>'BB','value'=>'2'],['name'=>'A','value'=>'3'],['name'=>'CC','value'=>'4']],'url'=>'/test_inputselect_json','theme'=>3])|raw
input选择
Collapse Title 4
$form_widget->form_input_select(['title'=>'input选择','name'=>'append','data'=>'A','_data'=>3,'list_arr'=> [['name'=>'AA','value'=>'1'],['name'=>'BB','value'=>'2'],['name'=>'A','value'=>'3'],['name'=>'CC','value'=>'4']],'url'=>'/test_inputselect_json','theme'=>4])|raw