public function run()
    {
        // If no routes have been added, then throw an exception
        try {
            if (empty($this->routes)) {
                throw new \RuntimeException('No routes exist in the routing table. Add some');
            }
        }
        catch (\Exception $e) {
            $this->error($e);
            return FALSE;
        }

        // Try and get a matching route for the current URL
        $route = $this->match(
            $this->request->getPathInfo(),
            $this->request->getMethod()
        );

        // Call not found handler if no match was found
        if ($route === null) {
            $this->not_found();
            return FALSE;
        }

        // Set current route
        $this->current_route = $route;

        // Get parameters from request
        $params = $this->parse_parameters($route);
        // Try to execute callback for route, if it fails, catch the exception and generate a HTTP 500 error
        try {
            $this->current_http_status = \Symfony\Component\HttpFoundation\Response::HTTP_OK;

            // Set response content
            $this->response->setContent($route->execute($params));

            // Send response
            $this->response->send();
            return TRUE;
        }
        catch (\Exception $e) {
            $this->error($e);
            return FALSE;
        }
    }
public function run()
    {
        // If no routes have been added, then throw an exception
        try {
            if (empty($this->routes)) {
                throw new \RuntimeException('No routes exist in the routing table. Add some');
            }
        }
        catch (\Exception $e) {
            $this->error($e);
            return FALSE;
        }

        // Try and get a matching route for the current URL
        $route = $this->match(
            $this->request->getPathInfo(),
            $this->request->getMethod()
        );

        // Call not found handler if no match was found
        if ($route === null) {
            $this->not_found();
            return FALSE;
        }

        // Set current route
        $this->current_route = $route;

        // Get parameters from request
        $params = $this->parse_parameters($route);
        // Try to execute callback for route, if it fails, catch the exception and generate a HTTP 500 error
        try {
            $this->current_http_status = \Symfony\Component\HttpFoundation\Response::HTTP_OK;

            // Set response content
            $this->response->setContent($route->execute($params));

            // Send response
            $this->response->send();
            return TRUE;
        }
        catch (\Exception $e) {
            $this->error($e);
            return FALSE;
        }
    }
public function run ( ) { // If no routes have been added, then throw an exception try { if ( empty ( $ this -> routes ) ) { throw new \ RuntimeException ( 'No routes exist in the routing table. Add some' ) ; } } catch ( \ Exception $ e ) { $ this -> error ( $ e ) ; return FALSE ; } // Try and get a matching route for the current URL $ route = $ this -> match ( $ this -> request -> getPathInfo ( ) , $ this -> request -> getMethod ( ) ) ; // Call not found handler if no match was found if ( $ route === null ) { $ this -> not_found ( ) ; return FALSE ; } // Set current route $ this -> current_route = $ route ; // Get parameters from request $ params = $ this -> parse_parameters ( $ route ) ; // Try to execute callback for route, if it fails, catch the exception and generate a HTTP 500 error try { $ this -> current_http_status = \ Symfony \ Component \ HttpFoundation \ Response :: HTTP_OK ; // Set response content $ this -> response -> setContent ( $ route -> execute ( $ params ) ) ; // Send response $ this -> response -> send ( ) ; return TRUE ; } catch ( \ Exception $ e ) { $ this -> error ( $ e ) ; return FALSE ; } }
Runs the router matching engine and then calls the matching route's
callback. otherwise execute the not found handler

@return bool
@throws \RuntimeException If no routes exist in the routing table
Runs the router matching engine and then calls the matching route s callback . otherwise execute the not found handler