Url
API reference › yii › helpers › Url
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.
Properties
Section titled “Properties”| Property | Type | Description | Defined by |
|---|---|---|---|
$urlManager static | yii\ | URL manager to use for creating URLs Default: null. Available since 2.0.8. | BaseUrl |
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
base() static | Returns the base URL of the current request. | BaseUrl |
canonical() static | Returns the canonical URL of the currently requested page. | BaseUrl |
current() static | Creates a URL by using the current route and the GET parameters. | BaseUrl |
ensureScheme() static | Normalize the URL by ensuring it uses specified scheme. | BaseUrl |
home() static | Returns the home URL. | BaseUrl |
isRelative() static | Returns a value indicating whether a URL is relative. | BaseUrl |
previous() static | Returns the URL previously remembered. | BaseUrl |
remember() static | Remembers the specified URL so that it can be later fetched back by previous(). | BaseUrl |
to() static | Creates a URL based on the given parameters. | BaseUrl |
toRoute() static | Creates a URL for the given route. | BaseUrl |
getUrlManager() protected static | BaseUrl | |
normalizeRoute() protected static | Normalizes route and makes it suitable for UrlManager. Absolute routes are staying as is while relative routes are converted to absolute ones. | BaseUrl |
resolveCurrentRoute() protected static | Resolves the route of the currently requested page. | BaseUrl |