PHP Interface yii\web\UrlRuleInterface

Since: 2.0
Author: Qiang Xue ([email protected])
Show file Open project: yiisoft/yii2

Public Methods

Method Description
createUrl ( UrlManager $manager, string $route, array $params ) : string | boolean Creates a URL according to the given route and parameters.
parseRequest ( UrlManager $manager, Request $request ) : array | boolean Parses the given request and returns the corresponding route and parameters.

Method Details

createUrl() public method

Creates a URL according to the given route and parameters.
public createUrl ( UrlManager $manager, string $route, array $params ) : string | boolean
$manager UrlManager the URL manager
$route string the route. It should not have slashes at the beginning or the end.
$params array the parameters
return string | boolean the created URL, or false if this rule cannot be used for creating this URL.

parseRequest() public method

Parses the given request and returns the corresponding route and parameters.
public parseRequest ( UrlManager $manager, Request $request ) : array | boolean
$manager UrlManager the URL manager
$request Request the request component
return array | boolean the parsing result. The route and the parameters are returned as an array. If false, it means this rule cannot be used to parse this path info.