ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
### API类调用方法 ~~~ $input = new api\input(); ~~~ ##### 隐藏传值表单 ~~~ $form = []; $form[] = $input->hid_val('字段名',['参数数组']); 例: $form = []; $form[] = $input->hid_val('sm_id',['data'=>$row]); ~~~ ##### 显示传值表单 ~~~ $form = []; $form[] = $input->dis_val('字段名',['参数数组']); 例: $form = []; $form[] = $input->dis_val('account',['name'=>'账号','data'=>$row]); ~~~ ##### 显示不传值表单 ~~~ $form = []; $form[] = $input->dis_null('字段名'),[参数数组]); 例: $form = []; $form[] = $input->dis_null('field',['name'=>'上游商户号','width'=>1,'data'=>$row,'limit'=>['null'=>1]]); ~~~ ##### Text文本文档 ~~~ $form = []; $form[] = $input->text('字段名',['参数数组']); 例: $form = []; $form[] = $input->text('field',['name'=>'账号','width'=>1,'note'=>'备注','limit'=>['null'=>1]]); ~~~ ##### password密码文本 ~~~ $form = []; $form[] = $input->password('字段名',['参数数组']); 例: $form = []; $form[] = $input->password('field',['name'=>'密码','width'=>1,'note'=>'备注']); ~~~ ##### Textarea多栏文本框 ~~~ $form = []; $form[] = $input -> textarea('字段名,['参数数组']); 例: $form = []; $form[] = $input->textarea('field',['name'=>'名称','width'=>12,'height'=>100,'note'=>'备注','limit'=>['null'=>1]]); ~~~ ##### radio多选表单 ~~~ $form = []; $form[] = $input->radio('字段名',['参数数组']); 例: $form = []; $obj = []; $obj['limit'] = 1; $obj[] = ['值','显示']; $form[] = $input->radio('enable',['name'=>'状态','data'=>$row,'opt'=>$obj]); ~~~ ##### checkbox多选表单 ~~~ $form = []; $form[] =$input -> checkbox('字段名',['参数数组']); 例: $form = []; $obj = []; $obj['limit'] = 1; $obj[] = ['值','显示']; $form[] = $input->checkbox('enable',['name'=>'状态','data'=>$row,'opt'=>$obj]); ~~~ ##### select下拉选择框 ~~~ $form = []; $form[] = $input -> select('字段名',['参数数组']); 例: $form = []; $obj = []; $obj['limit'] = 1; $obj[] = ['值','显示']; $form[] = $input->select('enable',['name'=>'状态','data'=>$row,'opt'=>$obj]); ~~~ ##### select_1带搜索功能的下拉选择框 ~~~ $form = []; $form[] = $input ->select_1('字段名',['参数数组']); 例: $form = []; $obj = []; $obj['limit'] = 1; $obj[] = ['值','显示','预选开关(1|0)']; $form[] = $input->select_1('enable',['name'=>'状态','data'=>$row,'opt'=>$obj]); ~~~ ##### select_2带搜索功能的下拉多选选择框 ~~~ $form = []; $form[] = $input ->select_2('字段名',['参数数组']); 例: $form = []; $obj = []; $obj[] = ['值','显示','预选开关(1|0)']; $form[] = $input->select_2('check',['name'=>'选择','data'=>$row,'opt'=>$obj]); ~~~ ##### upload 上传插件框 ~~~ $form = []; $form[] = $input ->upload('字段名',['参数数组']); 例: $form = []; $form[] = $input ->upload('字段名',['name'=>'显示名','up_type'=>'限制上传类型,多个/隔开','up_path'=>'[选填]存放路径指定','up_max'=>'限制文件大小(kb)']); ~~~ ##### rili 日历插件框 ~~~ $form = []; $form[] = $input ->rili('字段名',['参数数组']); 例: $form = []; $form[] = $input->rili('start_time',['name'=>'名称','width'=>12,'data'=> ['start_time'=> date('Y-m-d')],'note'=>'备注','limit'=>['null'=>1]]); ~~~ ##### note 预设辅助输入 ~~~ $form = []; $form[] = $input ->note('输入字段名',['参数数组']); 例: $option = []; $option[] = ['值','显示名称']; $form = []; $form[] = $input->note('field',['name'=>'名称','width'=>12,'option'=>$option]); ~~~ ##### text_add 添加多输入框 ~~~ $obj = []; $obj[] = ['name'=>'栏目1','width' => 6, 'note' => '备注']; $obj[] = ['name'=>'栏目2','width' => 6, 'note' => '备注']; $form[] = $input->text_add('field',['opt'=>$obj,'num'=> 1]); $total = explode(')%#', $model); foreach ($total as $key => $value) { $obj = explode('^!~', $value); $row['field0_'.$key] = $obj[0]; $row['field1_'.$key] = $obj[1]; } $obj = []; $obj[] = ['name'=>'栏目1','width' => 6, 'note' => '备注']; $obj[] = ['name'=>'栏目2','width' => 6, 'note' => '备注']; $form[] = $input->text_add('field',['opt'=>$obj,'num'=> 1,'num'=>count($total),'data'=>$row]); ~~~ ### form类调用 ~~~ $input = new form\input(); ~~~ ##### id表单唯一索引 ~~~ $form = $input -> id(); ~~~ ##### hiddle_value表单隐性传递参数 ~~~ $form = $input -> hiddle_value($time); ~~~ ##### submit表单提交按钮参数 ~~~ $form = $input -> submit($sbh_input); ~~~ ##### main表单主题内容 ~~~ $form = $input -> main($sbh_input); ~~~ ##### limit表单限定JS/新增JS限定样式 ~~~ $form1 = $input -> limit($form); ~~~