diff --git a/web/src/base.php b/web/src/base.php index 0f87d10..56b4cdb 100644 --- a/web/src/base.php +++ b/web/src/base.php @@ -12,6 +12,16 @@ function urlargs($from = 0) { } function tpl($ns, $args=[]) { + if (gettype($args) === 'string') { + $ps = explode('|', $args); + $args = []; + foreach ($ps as $p) { + $p = trim($p); + $k = trim(substr($p, 0, strpos($p, ':'))); + $v = trim(substr($p, strpos($p, ':')+1)); + $args[$k] = $v; + } + } $ns = str_replace('.','/',$ns); $__tfile = "_templates/$ns.php"; if (file_exists($__tfile)) {