没有命名空间的类 yii yii\base yii\behaviors yii\caching yii\captcha yii\console yii\console\controllers yii\console\widgets yii\data yii\db yii\db\conditions yii\db\cubrid yii\db\cubrid\conditions yii\db\mssql yii\db\mssql\conditions yii\db\mysql yii\db\oci yii\db\oci\conditions yii\db\pgsql yii\db\sqlite yii\db\sqlite\conditions yii\di yii\filters yii\filters\auth yii\grid yii\helpers yii\i18n yii\log yii\mail yii\mutex yii\rbac yii\rest yii\test yii\validators yii\web yii\widgets

Class yii\helpers\Url

继承yii\helpers\Url » yii\helpers\BaseUrl
可用版本自2.0
源码 https://github.com/yiichina/yii2/blob/api/framework/helpers/Url.php

Url 提供了一组静态方法用于管理 URLs。

有关 Url 的详细信息和用法,请参考 guide article on url helpers

公共属性

隐藏继承的属性

属性类型描述被定义在
$urlManager yii\web\UrlManager URL manager to use for creating URLs yii\helpers\BaseUrl

公共方法

隐藏继承的方法

方法描述被定义在
base() Returns the base URL of the current request. yii\helpers\BaseUrl
canonical() Returns the canonical URL of the currently requested page. yii\helpers\BaseUrl
current() Creates a URL by using the current route and the GET parameters. yii\helpers\BaseUrl
ensureScheme() Normalize URL by ensuring that it use specified scheme. yii\helpers\BaseUrl
home() Returns the home URL. yii\helpers\BaseUrl
isRelative() Returns a value indicating whether a URL is relative. yii\helpers\BaseUrl
previous() Returns the URL previously remembered. yii\helpers\BaseUrl
remember() Remembers the specified URL so that it can be later fetched back by previous(). yii\helpers\BaseUrl
to() Creates a URL based on the given parameters. yii\helpers\BaseUrl
toRoute() Creates a URL for the given route. yii\helpers\BaseUrl

受保护的方法

隐藏继承的方法

方法描述被定义在
getUrlManager() yii\helpers\BaseUrl
normalizeRoute() Normalizes route and makes it suitable for UrlManager. Absolute routes are staying as is while relative routes are converted to absolute ones. yii\helpers\BaseUrl