yii\helpers\Url - Yii2 类参考手册
Class yii\helpers\Url
| Inheritance | yii\helpers\Url » yii\helpers\BaseUrl |
|---|---|
| Available since version | 2.0 |
Url provides a set of static methods for managing URLs.
For more details and usage information on Url, see the guide article on url helpers.
Public Properties
隐藏继承的属性 Hide inherited properties
| 属性Property | 类型 Type | 简介 Description | 定义在 Defined By |
|---|---|---|---|
| $urlManager | yii\web\UrlManager | URL manager to use for creating URLs | yii\helpers\BaseUrl |
Public Methods
隐藏继承的方法 Hide inherited methods
| 方法 Method | 简介 Description | 定义在 Defined By |
|---|---|---|
| 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 |
Protected Methods
隐藏继承的方法 Hide inherited methods
| 方法 Method | 简介 Description | 定义在 Defined By |
|---|---|---|
| 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 |