Created method to get URL args consistently
This commit is contained in:
parent
beb561a5e5
commit
cc186de4aa
|
@ -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";
|
||||
|
|
Loading…
Reference in New Issue