I'm trying to create some kind of dispatcher for my web (cuz i have to do it manually and idk how can i do this)
$uri = array_filter(explode("/", filter_input(INPUT_SERVER, "PATH_INFO")));
$_SERVER["URI"] = $uri;
switch (sizeof($uri)) {
case 0:
error();
exit(0);
break;
case 1:
call_user_func("$uri[1]::__construct");
break;
default :
call_user_method_array("$uri[2]", call_user_func("$uri[1]::getInstance"));
break;
}
That's what i have but i get this:
- Strict standards: Only variables should be passed by reference in C:\wamp\www\BACK\index.php on line 180
- Deprecated: Function call_user_method_array() is deprecated in C:\wamp\www\BACK\index.php on line 180
- Warning: call_user_method_array() expects exactly 3 parameters, 2 given in C:\wamp\www\BACK\index.php on line 180
Sending http://localhost/BACK/index.php/Page/data?asd=1
and
- Warning: call_user_func() expects parameter 1 to be a valid callback, non-static method Page::__construct() cannot be called statically in C:\wamp\www\BACK\index.php on line 17
Sending http://localhost/BACK/index.php/Page?asd=1
I know i'm totally wrong but i can't find help...