/** * BaseController constructor. * @param \decoy\Application $application * @throws \Exception if method was not found */ public function __construct($application) { $this->identifier = uniqid(); $this->application = $application; $this->translator = $application->getTranslator(); $accepted = $this->forward()->getCurrentRoute()->getHttpAccept(); if (count($accepted) > 0 && !in_array($this->forward()->getRequestHeader()->getVariable('REQUEST_METHOD'), $accepted)) { $this->forward()->getRouter()->getRoute('error_page')->setAction('_notSupported'); $this->forward()->toRoute('error_page'); return; } $this->template = new ViewModel('application/layout'); $this->_Bootstrap(); $this->template->setAvailable($this->getApplication()->getViews(), $this->translator); $this->template->setConfig($this->getApplication()->getConfig()); $this->result = $this->_call(); $this->_Delegate(); }