From bb13ce4e18e6e984f89368bc2ec7d0dd69df6f16 Mon Sep 17 00:00:00 2001 From: dingyongliang Date: Thu, 16 Feb 2023 13:45:50 +0800 Subject: [PATCH] * zin: add label. --- zin/func.php | 1 + zin/wg/label/v1.php | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 zin/wg/label/v1.php diff --git a/zin/func.php b/zin/func.php index c0db048e78..27f66d4655 100644 --- a/zin/func.php +++ b/zin/func.php @@ -26,3 +26,4 @@ function center() {return createWg('center', func_get_args());} function cell() {return createWg('cell', func_get_args());} function actionItem() {return createWg('actionitem', func_get_args());} function nav() {return createWg('nav', func_get_args());} +function label() {return createWg('label', func_get_args());} diff --git a/zin/wg/label/v1.php b/zin/wg/label/v1.php new file mode 100644 index 0000000000..017fe4c4c4 --- /dev/null +++ b/zin/wg/label/v1.php @@ -0,0 +1,29 @@ +props->has('text')) + { + $this->props->set('text', $child); + return false; + } + return null; + } + + public function build() + { + return span( + $this->prop('text'), + setClass(array( + 'label', + $this->props->class->toStr(), + )), + ); + } +}