0 フォロワー

クラス yii\web\NotFoundHttpException

継承yii\web\NotFoundHttpException » yii\web\HttpException » yii\base\UserException » yii\base\Exception » Exception
利用可能バージョン2.0
ソースコード https://github.com/yiisoft/yii2/blob/master/framework/web/NotFoundHttpException.php

NotFoundHttpException は、ステータスコード 404 の「Not Found」HTTP 例外を表します。

こちらもご覧ください https://tools.ietf.org/html/rfc7231#section-6.5.4.

公開プロパティ

継承されたプロパティを隠す

プロパティ タイプ 説明 定義元
$statusCode integer HTTP ステータスコード(403、404、500など) yii\web\HttpException

公開メソッド

継承されたメソッドを隠す

メソッド 説明 定義元
__construct() コンストラクタ。 yii\web\NotFoundHttpException
getName() yii\web\HttpException

メソッドの詳細

継承されたメソッドを隠す

__construct() public method

コンストラクタ。

public void __construct ( $message null, $code 0, $previous null )
$message string|null

エラーメッセージ

$code integer

エラーコード

$previous Throwable|null

例外の連鎖に使用される前の例外。

                public function __construct($message = null, $code = 0, $previous = null)
{
    parent::__construct(404, $message, $code, $previous);
}

            
getName() public method
public string getName ( )
return string

この例外のユーザーフレンドリーな名前

                public function getName()
{
    if (isset(Response::$httpStatuses[$this->statusCode])) {
        return Response::$httpStatuses[$this->statusCode];
    }
    return 'Error';
}