類別 yii\web\UrlNormalizerRedirectException
繼承 | yii\web\UrlNormalizerRedirectException » yii\base\Exception » Exception |
---|---|
自版本起可用 | 2.0.10 |
原始碼 | https://github.com/yiisoft/yii2/blob/master/framework/web/UrlNormalizerRedirectException.php |
UrlNormalizerRedirectException 代表在 URL 正規化期間應執行的重新導向資訊。
公開屬性
屬性 | 類型 | 描述 | 定義於 |
---|---|---|---|
$scheme | boolean|string | 用於重新導向產生的 URL 中的 URI 協定 | yii\web\UrlNormalizerRedirectException |
$statusCode | integer | HTTP 狀態碼 | yii\web\UrlNormalizerRedirectException |
$url | array|string | 用於產生有效重新導向 URL 的參數 | yii\web\UrlNormalizerRedirectException |
屬性詳情
用於重新導向產生的 URL 中的 URI 協定
另請參閱 yii\helpers\Url::to()。
方法詳情
public void __construct ( $url, $statusCode = 302, $scheme = false, $message = null, $code = 0, $previous = null ) | ||
$url | array|string |
用於產生有效重新導向 URL 的參數。這將作為 yii\helpers\Url::to() 的第一個參數使用 |
$statusCode | integer |
用於重新導向的 HTTP 狀態碼 |
$scheme | boolean|string |
用於重新導向產生的 URL 中的 URI 協定。這將作為 yii\helpers\Url::to() 的第二個參數使用 |
$message | string|null |
錯誤訊息 |
$code | integer |
錯誤代碼 |
$previous | Throwable|null |
用於異常鏈結的前一個異常 |
public function __construct($url, $statusCode = 302, $scheme = false, $message = null, $code = 0, $previous = null)
{
$this->url = $url;
$this->scheme = $scheme;
$this->statusCode = $statusCode;
parent::__construct((string)$message, $code, $previous);
}
註冊 或 登入 以便發表評論。