getStatusCode() публичный Метод

public getStatusCode ( ) : integer
Результат integer the HTTP status code to send with the response.
 public function afterAction($action, $result)
 {
     $result = parent::afterAction($action, $result);
     if ($this->response->getStatusCode() == 200) {
         return $this->respondByFormat();
     }
     return $result;
 }
 public function afterAction($action, $result)
 {
     $errorHandler = Yii::$app->get('errorHandler');
     if (!empty($errorHandler->exception)) {
         $this->handleException($errorHandler->exception);
     }
     $result = parent::afterAction($action, $result);
     if ($this->response->getStatusCode() == 200) {
         return $this->respondByFormat();
     }
     return $result;
 }