/** * @param ActionEvent $event * @return boolean * @throws HttpException when the request method is not allowed. */ public function afterAction($event) { $response = Module::getInstance()->getServer()->getResponse(); $isValid = true; if ($response !== null) { $isValid = $response->isInformational() || $response->isSuccessful() || $response->isRedirection(); } if (!$isValid) { throw new HttpException($response->getStatusCode(), $this->getErrorMessage($response), $response->getParameter('error_uri')); } }
/** * @inheritdoc */ public function beforeAction($action) { $server = Module::getInstance()->getServer(); $server->verifyResourceRequest(); return parent::beforeAction($action); }