💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
:-: **添加form的控件Textarea** > addTextarea * * * * * * 源代码 ~~~ /** * @title 添加一个密码输入框组件 * @description 添加一个密码输入框组件 * @createtime: 2018/7/11 01:12 * @param string $name 组件要使用的input的name true '' '' * @param string $label 组件前面展示的标题 true '' '' * @param string $placeholder 显示的placeholder false '' '' * @param array $info 在组件使用的时候需要的条件 false [] '' * @param array $options 直接渲染在input上面的各种attr,赋值value需要写在options内 false [] '' * @return Form */ public function addPassword($name, $label, $placeholder = '', $info = [], $options = []){ $options = array_merge([ 'lay-verify' => '', 'required' => '', 'placeholder' => $placeholder, 'autocomplete' => "off", 'class' => "layui-input", 'style' => "", 'name' => $name ], $options); //判断需不需要填充内容 if(!isset($options['value']) && isset($options['name']) && isset($this->formValue[$options['name']]) ){ $options['value'] = $this->formValue[$options['name']]; } $options = array_filter($options); return $this->addControl("password", $label, array_merge([ 'inline' => "layui-input-block", ], $info), $options); } ~~~ 是用参考源代码