/** * Execute middleware and controller */ public function execute() { try { $this->executeMiddleware(); $this->executeController(); } catch (PageNotFoundException $e) { $controllerObject = new AppController($this->container); $controllerObject->notFound($e->hasLayout()); } catch (AccessForbiddenException $e) { $controllerObject = new AppController($this->container); $controllerObject->accessForbidden($e->hasLayout()); } }
/** * Execute middleware and controller */ public function execute() { try { $this->executeMiddleware(); if (!$this->response->isResponseAlreadySent()) { $this->executeController(); } } catch (PageNotFoundException $e) { $controllerObject = new AppController($this->container); $controllerObject->notFound($e->hasLayout()); } catch (AccessForbiddenException $e) { $controllerObject = new AppController($this->container); $controllerObject->accessForbidden($e->hasLayout(), $e->getMessage()); } }