public function run($url = null, $method = null)
    {
        $route = $this->altoRouter->match($url, $method);
        if (!$route) {
            throw new NotFoundException(((isset($_SERVER['REQUEST_URI']) && !empty($_SERVER['REQUEST_URI'])) ? $_SERVER['REQUEST_URI'] : (($url != null) ? $url : "/")) . " is not reachable.");
        }
        if (!isset($route['target']['c']) || !isset($route['target']['a']) || !isset($route['params'])) {
            throw new FrameworkException('Internal Framework Error. [!BAD_ROUTER_TARGET]', 001);
        }
        if (is_callable(array($route['target']['c'], 'getInstance'))) {
            $controller = $route['target']['c']::getInstance();
            if (method_exists($controller, $route['target']['a'])) {
                call_user_func(array($controller, $route['target']['a']), array_values($route['params']));
                $controller->response->send();
            } else {
                throw new FrameworkException('Internal Framework Error. [METHOD_DOES_NOT_EXISTS]', 002);
            }
        } else {
            throw new FrameworkException('Internal Framework Error. [CONTROLLER_DOES_NOT_EXISTS]', 003);
        }
    }
public function run($url = null, $method = null)
    {
        $route = $this->altoRouter->match($url, $method);
        if (!$route) {
            throw new NotFoundException(((isset($_SERVER['REQUEST_URI']) && !empty($_SERVER['REQUEST_URI'])) ? $_SERVER['REQUEST_URI'] : (($url != null) ? $url : "/")) . " is not reachable.");
        }
        if (!isset($route['target']['c']) || !isset($route['target']['a']) || !isset($route['params'])) {
            throw new FrameworkException('Internal Framework Error. [!BAD_ROUTER_TARGET]', 001);
        }
        if (is_callable(array($route['target']['c'], 'getInstance'))) {
            $controller = $route['target']['c']::getInstance();
            if (method_exists($controller, $route['target']['a'])) {
                call_user_func(array($controller, $route['target']['a']), array_values($route['params']));
                $controller->response->send();
            } else {
                throw new FrameworkException('Internal Framework Error. [METHOD_DOES_NOT_EXISTS]', 002);
            }
        } else {
            throw new FrameworkException('Internal Framework Error. [CONTROLLER_DOES_NOT_EXISTS]', 003);
        }
    }
public function run ( $ url = null , $ method = null ) { $ route = $ this -> altoRouter -> match ( $ url , $ method ) ; if ( ! $ route ) { throw new NotFoundException ( ( ( isset ( $ _SERVER [ 'REQUEST_URI' ] ) && ! empty ( $ _SERVER [ 'REQUEST_URI' ] ) ) ? $ _SERVER [ 'REQUEST_URI' ] : ( ( $ url != null ) ? $ url : "/" ) ) . " is not reachable." ) ; } if ( ! isset ( $ route [ 'target' ] [ 'c' ] ) || ! isset ( $ route [ 'target' ] [ 'a' ] ) || ! isset ( $ route [ 'params' ] ) ) { throw new FrameworkException ( 'Internal Framework Error. [!BAD_ROUTER_TARGET]' , 001 ) ; } if ( is_callable ( array ( $ route [ 'target' ] [ 'c' ] , 'getInstance' ) ) ) { $ controller = $ route [ 'target' ] [ 'c' ] :: getInstance ( ) ; if ( method_exists ( $ controller , $ route [ 'target' ] [ 'a' ] ) ) { call_user_func ( array ( $ controller , $ route [ 'target' ] [ 'a' ] ) , array_values ( $ route [ 'params' ] ) ) ; $ controller -> response -> send ( ) ; } else { throw new FrameworkException ( 'Internal Framework Error. [METHOD_DOES_NOT_EXISTS]' , 002 ) ; } } else { throw new FrameworkException ( 'Internal Framework Error. [CONTROLLER_DOES_NOT_EXISTS]' , 003 ) ; } }
This function runs the router and call the apropriate
This function runs the router and call the apropriate