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

Constructor.
public __construct ( integer $status, string $message = null, integer $code, Exception $previous = null )
$status integer the exit status code
$message string error message
$code integer error code
$previous Exception The previous exception used for the exception chaining.
Пример #1
0
 /**
  * Конструктор
  * @param string $name Название (выведем в качестве названия страницы)
  * @param string $message Подробное сообщение об ошибке
  * @param int $code Код ошибки
  * @param int $status Статус ответа
  * @param \Exception $previous Предыдущее исключение
  */
 public function __construct($name, $message = null, $code = 0, $status = 500, \Exception $previous = null)
 {
     # Генерируем ответ
     $view = yii::$app->getView();
     $response = yii::$app->getResponse();
     $response->data = $view->renderFile('@app/views/exception.php', ['name' => $name, 'message' => $message]);
     # Возвратим нужный статус (по-умолчанию отдадим 500-й)
     $response->setStatusCode($status);
     parent::__construct($status, $message, $code, $previous);
 }