public function run()
    {
        if (!$this->initialized) {
            $this->initialize();
        }

        // Get the current url
        $currentUrl     = $this->toolkit->getCurrentUrl();
        $currentFullUrl = $this->toolkit->getCurrentUrlFull();

        // And try to match the route
        $this->hook->trigger(self::HOOK_ROUTE_MATCH_BEFORE, $currentUrl);
        $route = $this->router->matchUrl($currentUrl);
        $this->hook->trigger(self::HOOK_ROUTE_MATCH_AFTER, $route);

        if ($route) {
            $this->dispatchRoute($route);
        } else {
            $this->response->setHttpCode(404);
            $this->hook->trigger(self::HOOK_HTTP_404, $currentFullUrl);
        }

        $this->loadLayout();

        $this->hook->trigger(self::HOOK_RESPONSE_SEND);
        $this->response->send();
        return $this;
    }
public function run()
    {
        if (!$this->initialized) {
            $this->initialize();
        }

        // Get the current url
        $currentUrl     = $this->toolkit->getCurrentUrl();
        $currentFullUrl = $this->toolkit->getCurrentUrlFull();

        // And try to match the route
        $this->hook->trigger(self::HOOK_ROUTE_MATCH_BEFORE, $currentUrl);
        $route = $this->router->matchUrl($currentUrl);
        $this->hook->trigger(self::HOOK_ROUTE_MATCH_AFTER, $route);

        if ($route) {
            $this->dispatchRoute($route);
        } else {
            $this->response->setHttpCode(404);
            $this->hook->trigger(self::HOOK_HTTP_404, $currentFullUrl);
        }

        $this->loadLayout();

        $this->hook->trigger(self::HOOK_RESPONSE_SEND);
        $this->response->send();
        return $this;
    }
public function run ( ) { if ( ! $ this -> initialized ) { $ this -> initialize ( ) ; } // Get the current url $ currentUrl = $ this -> toolkit -> getCurrentUrl ( ) ; $ currentFullUrl = $ this -> toolkit -> getCurrentUrlFull ( ) ; // And try to match the route $ this -> hook -> trigger ( self :: HOOK_ROUTE_MATCH_BEFORE , $ currentUrl ) ; $ route = $ this -> router -> matchUrl ( $ currentUrl ) ; $ this -> hook -> trigger ( self :: HOOK_ROUTE_MATCH_AFTER , $ route ) ; if ( $ route ) { $ this -> dispatchRoute ( $ route ) ; } else { $ this -> response -> setHttpCode ( 404 ) ; $ this -> hook -> trigger ( self :: HOOK_HTTP_404 , $ currentFullUrl ) ; } $ this -> loadLayout ( ) ; $ this -> hook -> trigger ( self :: HOOK_RESPONSE_SEND ) ; $ this -> response -> send ( ) ; return $ this ; }
Do all the setup and then attempt to match and dispatch the current url.

@return $this
Do all the setup and then attempt to match and dispatch the current url .