自定义表单优化
This commit is contained in:
@@ -57,6 +57,22 @@ class FormAttr extends Base{
|
||||
return $type_text[0];
|
||||
}
|
||||
|
||||
protected function getExtraListAttr($value, $data){
|
||||
$extra = [];
|
||||
if ($data['extra']) {
|
||||
$e = explode("\r\n", $data['extra']);
|
||||
foreach ($e as $key => $value) {
|
||||
if (strrpos($value, ":")) {
|
||||
list($k, $v) = explode(":", $value);
|
||||
$extra[] = ['key'=> $k, 'label' =>$v];
|
||||
}else{
|
||||
$extra[] = ['key'=> $key, 'label' =>$value];
|
||||
}
|
||||
}
|
||||
}
|
||||
return $extra;
|
||||
}
|
||||
|
||||
public function getFieldlist($map,$index='id'){
|
||||
$list = array();
|
||||
$row = $this->field('*,remark as help,type,extra as "option"')->where($map)->order('group_id asc, sort asc')->select();
|
||||
|
||||
Reference in New Issue
Block a user