From 6eedec6e5e55e63439fd689885d2afd225a51560 Mon Sep 17 00:00:00 2001 From: sunhao Date: Mon, 18 Mar 2024 10:13:12 +0800 Subject: [PATCH] * zin: refactor form widget. --- lib/zin/wg/form/v1.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/zin/wg/form/v1.php b/lib/zin/wg/form/v1.php index d4b1b54e1a..ae72003a9e 100644 --- a/lib/zin/wg/form/v1.php +++ b/lib/zin/wg/form/v1.php @@ -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(); + } }