| fantomel |
06-14-2009 06:40 PM |
primitive url routing
hello i'm tryign to build a routing system and i'm playing a little to understand how it works but i`ve got a debugging problem can please someone help me?
PHP Code:
$url = $_SERVER['REQUEST_URI'];
$array = explode("/", $url);
$action = 'index';
$dispatch = new $array[1];
if(method_exists($dispatch, $action))
{
call_user_func_array($dispatch, $action);
}
My Error: Catchable fatal error: Object of class Blog could not be converted to string in C:\xampp\htdocs\public\index.php on line 11
|