0 フォロワー

クラス yii\web\MethodNotAllowedHttpException

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

MethodNotAllowedHttpException は、ステータスコード 405 の「許可されていないメソッド」HTTP 例外を表します。

こちらも参照してください https://tools.ietf.org/html/rfc7231#section-6.5.5

公開プロパティ

継承されたプロパティを非表示

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

公開メソッド

継承されたメソッドを非表示

メソッド 説明 定義元
__construct() コンストラクタ。 yii\web\MethodNotAllowedHttpException
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(405, $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';
}