helpers\BaseUrl to()

to() public static method Creates a URL based on the given parameters. This method is very similar to toRoute(). The only difference is that this method requires a route to be specified as an array only. If a string is given, it will be treated as a URL. In particular, if $url is an array: toRoute() will be called to generate the URL. For example: ['site/index'], ['post/index', 'page' => 2]. Please refer to toRoute() for more details on how to specify a route. a string with a leading @:

helpers\BaseUrl remember()

remember() public static method Remembers the specified URL so that it can be later fetched back by previous(). See also previous(). public static void remember ( $url = '', $name = null )$url string|array The URL to remember. Please refer to to() for acceptable formats. If this parameter is not specified, the currently requested URL will be used. $name string The name associated with the URL to be remembered. This can be used later by previous(). If not set, it will use yii\web\User

helpers\BaseUrl previous()

previous() public static method Returns the URL previously remembered. See also remember(). public static string|null previous ( $name = null )$name string The named associated with the URL that was remembered previously. If not set, it will use yii\web\User::$returnUrlParam. return string|null The URL previously remembered. Null is returned if no URL was remembered with the given name.

helpers\BaseUrl normalizeRoute()

normalizeRoute() protected static method Normalizes route and makes it suitable for UrlManager. Absolute routes are staying as is while relative routes are converted to absolute ones. A relative route is a route without a leading slash, such as "view", "post/view". If the route is an empty string, the current route will be used; If the route contains no slashes at all, it is considered to be an action ID of the current controller and will be prepended with yii\web\Controller::$uniqueId; If

helpers\BaseUrl isRelative()

isRelative() public static method Returns a value indicating whether a URL is relative. A relative URL does not have host info part. public static boolean isRelative ( $url )$url string The URL to be checked return boolean Whether the URL is relative

helpers\BaseUrl home()

home() public static method Returns the home URL. public static string home ( $scheme = false )$scheme boolean|string The URI scheme to use for the returned URL: false (default): returning a relative URL. true: returning an absolute base URL whose scheme is the same as that in yii\web\UrlManager::$hostInfo. string: returning an absolute URL with the specified scheme (either http or https). return string Home URL

helpers\BaseUrl getUrlManager()

getUrlManager() protected static method (available since version 2.0.8) protected static yii\web\UrlManager getUrlManager ( )return yii\web\UrlManager URL manager used to create URLs

helpers\BaseUrl current()

current() public static method (available since version 2.0.3) Creates a URL by using the current route and the GET parameters. You may modify or remove some of the GET parameters, or add additional query parameters through the $params parameter. In particular, if you specify a parameter to be null, then this parameter will be removed from the existing GET parameters; all other parameters specified in $params will be merged with the existing GET parameters. For example, // assume $_GET = ['

helpers\BaseUrl canonical()

canonical() public static method Returns the canonical URL of the currently requested page. The canonical URL is constructed using the current controller's yii\web\Controller::$route and yii\web\Controller::$actionParams. You may use the following code in the layout view to add a link tag about canonical URL: $this->registerLinkTag(['rel' => 'canonical', 'href' => Url::canonical()]); public static string canonical ( )return string The canonical URL of the currently requested pa

helpers\BaseUrl base()

base() public static method Returns the base URL of the current request. public static string base ( $scheme = false )$scheme boolean|string The URI scheme to use in the returned base URL: false (default): returning the base URL without host info. true: returning an absolute base URL whose scheme is the same as that in yii\web\UrlManager::$hostInfo. string: returning an absolute base URL with the specified scheme (either http or https).