类 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);
}
注册 或者 登录 评论。