public function dispatch() { $this->response->fromArray($this->request->toArray()); try { parent::dispatch(); $this->response->breadcrumbs = $this->breadcrumbs->getByRoute($this->request->route); $this->response->app = $this->router->controller; $this->response->template = !empty($this->response->template) ? $this->response->template : $this->router->action; } catch (\Http\Exception $e) { $this->response->app = 'Error'; $this->response->template = $e->getCode() ? '/' . $e->getCode() : '/404'; } }