* zin: support to create h5 node with createWg.
This commit is contained in:
@@ -18,6 +18,8 @@ require_once __DIR__ . DS . 'directive.class.php';
|
||||
|
||||
class h extends node
|
||||
{
|
||||
public static array $h5Tags = array('div', 'span', 'strong', 'small', 'code', 'canvas', 'br', 'a', 'p', 'img', 'button', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'ol', 'ul', 'li', 'template', 'fieldset', 'legend');
|
||||
|
||||
public static array $defineProps = array
|
||||
(
|
||||
'tagName' => 'string',
|
||||
|
||||
@@ -32,6 +32,7 @@ function h3(mixed ...$args): h {return h::h3(...$args);}
|
||||
function h4(mixed ...$args): h {return h::h4(...$args);}
|
||||
function h5(mixed ...$args): h {return h::h5(...$args);}
|
||||
function h6(mixed ...$args): h {return h::h6(...$args);}
|
||||
function ol(mixed ...$args): h {return h::ol(...$args);}
|
||||
function ul(mixed ...$args): h {return h::ul(...$args);}
|
||||
function li(mixed ...$args): h {return h::li(...$args);}
|
||||
function template(mixed ...$args): h {return h::template(...$args);}
|
||||
|
||||
@@ -42,6 +42,11 @@ function createWg($name, $args, ?string $fallbackWgName = null): node
|
||||
$wgVer = getWgVer($name);
|
||||
$wgName = "\\zin\\$name";
|
||||
|
||||
if(in_array($name, h::$h5Tags))
|
||||
{
|
||||
return h::$name($args);
|
||||
}
|
||||
|
||||
if(!class_exists($wgName))
|
||||
{
|
||||
include_once dirname(__DIR__) . DS . 'wg' . DS . $name . DS . "v$wgVer.php";
|
||||
|
||||
Reference in New Issue
Block a user