没有命名空间的类 yii yii\base yii\behaviors yii\caching yii\captcha yii\console yii\console\controllers yii\console\widgets yii\data yii\db yii\db\conditions yii\db\cubrid yii\db\cubrid\conditions yii\db\mssql yii\db\mssql\conditions yii\db\mysql yii\db\oci yii\db\oci\conditions yii\db\pgsql yii\db\sqlite yii\db\sqlite\conditions yii\di yii\filters yii\filters\auth yii\grid yii\helpers yii\i18n yii\log yii\mail yii\mutex yii\rbac yii\rest yii\test yii\validators yii\web yii\widgets

Interface yii\web\UrlRuleInterface

实现yii\rest\UrlRule, yii\web\CompositeUrlRule, yii\web\GroupUrlRule, yii\web\UrlRule
可用版本自2.0
源码 https://github.com/yiichina/yii2/blob/api/framework/web/UrlRuleInterface.php

UrlRuleInterface is the interface that should be implemented by URL rule classes.

公共方法

隐藏继承的方法

方法描述被定义在
createUrl() Creates a URL according to the given route and parameters. yii\web\UrlRuleInterface
parseRequest() Parses the given request and returns the corresponding route and parameters. yii\web\UrlRuleInterface

方法详情

createUrl() 公共 抽象 方法

Creates a URL according to the given route and parameters.

public abstract string|boolean createUrl($manager, $route, $params)
$manager yii\web\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() 公共 抽象 方法

Parses the given request and returns the corresponding route and parameters.

public abstract array|boolean parseRequest($manager, $request)
$manager yii\web\UrlManager

The URL manager

$request yii\web\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.