* zin: refactor form widget.

This commit is contained in:
sunhao
2024-03-20 09:10:45 +08:00
committed by liyang
parent 0b7aa4b55f
commit 6eedec6e5e
+10 -1
View File
@@ -96,7 +96,10 @@ class form extends formBase
$this->setProp('pinnedItems', explode(',', $config->$module->custom->$key));
}
}
}
protected function beforeBuild()
{
$fields = $this->prop('fields');
if(is_string($fields)) $fields = explode(',', $fields);
if(is_array($fields)) $fields = useFields($fields);
@@ -117,7 +120,7 @@ class form extends formBase
$this->setProp('autoLoad', $autoLoad);
}
}
}
}
protected function getItemLabel(string $name): ?string
{
@@ -317,4 +320,10 @@ class form extends formBase
return $items;
}
protected function build()
{
$this->beforeBuild();
return parent::build();
}
}