web\UrlManager setRuleToCache()

setRuleToCache() protected method (available since version 2.0.8) Store rule (e.g. yii\web\UrlRule) to internal cache protected void setRuleToCache ( $cacheKey, yii\web\UrlRuleInterface $rule )$cacheKey $rule yii\web\UrlRuleInterface

web\UrlManager setBaseUrl()

setBaseUrl() public method Sets the base URL that is used by createUrl() to prepend to created URLs. This is mainly used when $enablePrettyUrl is true and $showScriptName is false. public void setBaseUrl ( $value )$value string The base URL that is used by createUrl() to prepend to created URLs.

web\UrlManager setHostInfo()

setHostInfo() public method Sets the host info that is used by createAbsoluteUrl() to prepend to created URLs. public void setHostInfo ( $value )$value string The host info (e.g. "http://www.example.com") that is used by createAbsoluteUrl() to prepend to created URLs.

web\UrlManager init()

init() public method Initializes UrlManager. public void init ( )

web\UrlManager parseRequest()

parseRequest() public method Parses the user request. public array|boolean parseRequest ( $request )$request yii\web\Request The request component return array|boolean The route and the associated parameters. The latter is always empty if $enablePrettyUrl is false. false is returned if the current request cannot be successfully parsed.

web\UrlManager getScriptUrl()

getScriptUrl() public method Returns the entry script URL that is used by createUrl() to prepend to created URLs. It defaults to yii\web\Request::$scriptUrl. This is mainly used when $enablePrettyUrl is false or $showScriptName is true. public string getScriptUrl ( )return string The entry script URL that is used by createUrl() to prepend to created URLs. throws yii\base\InvalidConfigException if running in console application and $scriptUrl is not configured.

web\UrlManager getUrlFromCache()

getUrlFromCache() protected method (available since version 2.0.8) Get URL from internal cache if exists See also createUrl(). protected boolean|string getUrlFromCache ( $cacheKey, $route, $params )$cacheKey string Generated cache key to store data. $route string The route (e.g. site/index). $params array Rule params. return boolean|string The created URL

web\UrlManager getHostInfo()

getHostInfo() public method Returns the host info that is used by createAbsoluteUrl() to prepend to created URLs. public string getHostInfo ( )return string The host info (e.g. "http://www.example.com") that is used by createAbsoluteUrl() to prepend to created URLs. throws yii\base\InvalidConfigException if running in console application and $hostInfo is not configured.

web\UrlManager createUrl()

createUrl() public method Creates a URL using the given route and query parameters. You may specify the route as a string, e.g., site/index. You may also use an array if you want to specify additional query parameters for the URL being created. The array format must be: // generates: /index.php?r=site%2Findex&param1=value1&param2=value2 ['site/index', 'param1' => 'value1', 'param2' => 'value2'] If you want to create a URL with an anchor, you can use the array format with a #

web\UrlManager createAbsoluteUrl()

createAbsoluteUrl() public method Creates an absolute URL using the given route and query parameters. This method prepends the URL created by createUrl() with the $hostInfo. Note that unlike yii\helpers\Url::toRoute(), this method always treats the given route as an absolute route. See also createUrl(). public string createAbsoluteUrl ( $params, $scheme = null )$params string|array Use a string to represent a route (e.g. site/index), or an array to represent a route with query paramete