多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
:-: **添加form的控件** > addControl * * * * * * 源代码 ~~~ /** * @title 作为基础方法,也是其他方法最后调用的 * @description 作为基础方法,也是其他方法最后调用的,如果需要自定义的话,只需在type处写HTML * @createtime: 2018/7/11 00:32 * @param string $type 定义的类型,有其他类型,也可以直接在此处写html true '' '' * @param string $label 前面显示的标题内容 false '' '' * @param array $info 这个组件的一些参数,不会渲染到html中 false [] '' * @param array $options 这个组件的HTML中attr false [] '' * @return $this */ public function addControl($type, $label = '', $info = [], $options = []){ //如果在inline状态下 if($this->formIsInLine){ $this->forminlinecontrols[] = [ 'type' => $type, 'label' => $label, 'options' => $options, 'info' => $info ]; }else{ $this->formcontrols[] = [ [ 'type' => $type, 'label' => $label, 'options' => $options, 'info' => $info ] ]; } return $this; } ~~~ * * * * * 使用方法 ~~~ $form->addControl();//一般该方法无需使用,其他方法底层即为该方法,除非针对该项目有自定义的组件,需要使用,使用说明参考上方api ~~~