* zin: refactor

This commit is contained in:
Hao Sun
2023-02-17 15:48:49 +08:00
parent eabdb6c8b5
commit 3682a0fd8a
2 changed files with 10 additions and 7 deletions
-1
View File
@@ -1,5 +1,4 @@
<?php
namespace zin;
class dtable extends wg
+10 -6
View File
@@ -1,18 +1,22 @@
<?php
namespace zin;
class row extends wg
{
static $defineProps = 'justify,align';
static $defineProps = 'justify?:string, align?:string';
protected function build()
{
$justify = empty($this->prop('justify')) ? 'start' : $this->prop('justify');
$align = empty($this->prop('align')) ? 'start' : $this->prop('align');
list($justify, $align) = $this->prop(array('justify', 'align'));
return div(
setClass("row justify-$justify items-$align"),
return div
(
setClass
(
'row',
empty($justify) ? null : "justify-$justify",
empty($align) ? null : "items-$align"
),
set($this->props->skip(array_keys(static::getDefinedProps()))),
$this->children()
);