public function run() { $this->initRouter()->initView()->initDispatcher()->initErrorHandler()->initKit(); $this->_router->construct(); try { $this->_dispatcher->dispatch($this->_router, $this->_view, $this); } catch (\Exception $e) { $this->_errorHandler->manageError($e); $this->_dispatcher->dispatch($this->_errorHandler->getRouter(), $this->_view, $this); } }
public function __construct($resource, $argument, Router $router) { $this->_router = $router; $this->_restRule = $router->getResources(); $this->resource($resource, $argument); }