diff --git a/lib/zin/wg/icon/v1.php b/lib/zin/wg/icon/v1.php index 2b7ba01a44..153546cfea 100644 --- a/lib/zin/wg/icon/v1.php +++ b/lib/zin/wg/icon/v1.php @@ -33,4 +33,18 @@ class icon extends wg $this->children() ); } + + public static function create(string|array $nameOrProps, ?array $props = null, mixed ...$children): static + { + $props = $props ? $props : array(); + if(is_string($nameOrProps)) + { + $props['name'] = $nameOrProps; + } + else + { + $props = array_merge($nameOrProps, $props); + } + return new static(set($props), ...$children); + } }