Created method to get URL args consistently

This commit is contained in:
Niko 2022-02-10 10:50:35 +01:00
parent beb561a5e5
commit cc186de4aa
1 changed files with 7 additions and 0 deletions

View File

@ -4,6 +4,13 @@ function s($name) {
echo $name;
}
function urlargs($from = 0) {
$uri = trim($_SERVER['REQUEST_URI'],'/');
$args = explode('/', $uri);
array_splice($args, 0, $from);
return $args;
}
function tpl($ns, $args=[]) {
$ns = str_replace('.','/',$ns);
$__tfile = "_templates/$ns.php";