/** * @return bool * @throws \Exception */ public function execute() { try { $this->request->setDispatched(true); $methodName = $this->getMethodName(); if (!method_exists($this, $methodName)) { throw new \InvalidArgumentException("method does not exists"); } $this->{$methodName}(); } catch (\Exception $e) { $this->request->setException($e); $this->request->forward('\\Platform\\Core\\Controller\\Ajax\\ErrorController', 'exception'); } return true; }
/** * @return bool */ public function execute() { try { $accept = true; if (!$this->passNetworkBrowseMode()) { $accept = false; $this->request->forward('\\Platform\\User\\Controller\\AuthController', 'login'); } if (!$this->passMaintenanceMode()) { $accept = false; $this->request->forward('\\Platform\\Core\\Controller\\MaintenanceController', 'index'); } if ($accept) { $this->request->setDispatched(true); $methodName = $this->getMethodName(); $this->{$methodName}(); } } catch (\Exception $e) { $this->request->setException($e); $this->request->forward('\\Platform\\Core\\Controller\\ErrorController', 'exception'); } return true; }