💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
## 属性 (只写) `$formControl array 组控件项` ## 方法 设置组控件项: ```php $formBuilder->setFormControl([ 'j' => $this->formControl->textarea()->label('文本域')->required()->defaultValue('卧槽我\r\n卧槽"\'' . PHP_EOL), 'k' => $this->formControl->checkbox()->defaultValue(['a'])->options(['a' => '我', 'b' => '是', 'c' => '神',])->required()->label('标签')->tag(), 'l' => $this->formControl->checkbox()->defaultValue(['e', 'f'])->options(['d' => '我', 'e' => '是', 'f' => '神',])->required()->label('多选'), 'm' => $this->formControl->sw()->label('开关')->required()->checked(), 'n' => $this->formControl->hidden()->defaultValue('冲冲冲'), 'o' => $this->formControl->password()->label('密码')->required()->defaultValue('123456'), 'p' => $this->formControl->radio()->options(['g' => '我', 'h' => '是', 'i' => '神',])->defaultValue('h')->required()->label('单选'), 'q' => $this->formControl->range()->required()->label('范围')->defaultValue(1), ]); // $this ``` ## 示例 ~~~ /** * @return string * @throws \ReflectionException * @throws \builder\base\UndefinedParamsException * @throws \yii\base\InvalidConfigException */ public function actionDynamicSelect() { if ($this->isPost) { return $this->asOk('提交成功'); } else { $formBuilder = FormBuilder::instance(); $formBuilder->setTitle('动态下拉框') ->setRequiredStyle() ->setFormControl([ 'a' => $this->formControl->text()->label('普通文本'), 'b' => $this->formControl->selectDynamic() ->label('动态下拉1') ->layout(12) ->required() ->placeholder('请填写一下') ->defaultValue(['F']) ->multiple() //->refreshBtn() //->refreshBtnPosition() ->additionBtn(function (DselectModal $modal) { return $modal->route('form/addition')->title('新增')->height(230); }) //->additionBtnPosition() ->dataUrl('form/link') ->comment(''), ]) ->setResetBtn() ->setSubmitBtn(); return $formBuilder->render(); } } ~~~