Yii Framework v1.1.10 类参考
CBaseUrlRule
包 | system.web |
---|---|
继承 | abstract class CBaseUrlRule » CComponent |
子类 | CUrlRule |
源自 | 1.1.8 |
版本 | $Id: CUrlManager.php 3515 2011-12-28 12:29:24Z mdomba $ |
源码 | framework/web/CUrlManager.php |
CBaseUrlRule is the base class for a URL rule class.
Custom URL rule classes should extend from this class and implement two methods: createUrl and parseUrl.
Custom URL rule classes should extend from this class and implement two methods: createUrl and parseUrl.
公共属性
属性 | 类型 | 描述 | 定义在 |
---|---|---|---|
hasHostInfo | boolean | whether this rule will also parse the host info part. | CBaseUrlRule |
公共方法
属性详细
hasHostInfo
属性
public boolean $hasHostInfo;
whether this rule will also parse the host info part. Defaults to false.
方法详细
createUrl()
方法
abstract public mixed createUrl(CUrlManager $manager, string $route, array $params, string $ampersand)
| ||
$manager | CUrlManager | the manager |
$route | string | the route |
$params | array | list of parameters (name=>value) associated with the route |
$ampersand | string | the token separating name-value pairs in the URL. |
{return} | mixed | the constructed URL. False if this rule does not apply. |
源码: framework/web/CUrlManager.php#538 (显示)
abstract public function createUrl($manager,$route,$params,$ampersand);
Creates a URL based on this rule.
parseUrl()
方法
abstract public mixed parseUrl(CUrlManager $manager, CHttpRequest $request, string $pathInfo, string $rawPathInfo)
| ||
$manager | CUrlManager | the URL manager |
$request | CHttpRequest | the request object |
$pathInfo | string | path info part of the URL (URL suffix is already removed based on CUrlManager::urlSuffix) |
$rawPathInfo | string | path info that contains the potential URL suffix |
{return} | mixed | the route that consists of the controller ID and action ID. False if this rule does not apply. |
源码: framework/web/CUrlManager.php#547 (显示)
abstract public function parseUrl($manager,$request,$pathInfo,$rawPathInfo);
Parses a URL based on this rule.