| 包 | system.web |
|---|---|
| 继承 | abstract class CBaseUrlRule » CComponent |
| 子类 | curlRule |
| 源自 | 1.1.8 |
| 版本 | $Id: CUrlManager.PHP 3515 2011-12-28 12:29:24Z mDOMba $ |
| 源码 |
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 |
公共方法
| 方法 | 描述 | 定义在 |
|---|---|---|
| __call() | 如果类中没有调的方法名,则调用这个方法。 | CComponent |
| __get() | 返回一个属性值、一个事件处理程序列表或一个行为名称。 | CComponent |
| __isset() | 检查一个属性是否为null。 | CComponent |
| __set() | 设置一个组件的属性值。 | CComponent |
| __unset() | 设置一个组件的属性为null。 | CComponent |
| asa() | 返回这个名字的行为对象。 | CComponent |
| attachBehavior() | 附加一个行为到组件。 | CComponent |
| attachBehaviors() | 附加一个行为列表到组件。 | CComponent |
| attachEventHandler() | 为事件附加一个事件处理程序。 | CComponent |
| canGetProperty() | 确定属性是否可读。 | CComponent |
| canSetProperty() | 确定属性是否可写。 | CComponent |
| createUrl() | Creates a URL based on this rule. | CBaseUrlRule |
| detachBehavior() | 从组件中分离一个行为。 | CComponent |
| detachBehaviors() | 从组件中分离所有行为。 | CComponent |
| detachEventHandler() | 分离一个存在的事件处理程序。 | CComponent |
| disableBehavior() | 禁用一个附加行为。 | CComponent |
| disableBehaviors() | 禁用组件附加的所有行为。 | CComponent |
| enableBehavior() | 启用一个附加行为。 | CComponent |
| enableBehaviors() | 启用组件附加的所有行为。 | CComponent |
| evaLuateExpression() | 计算一个PHP表达式,或根据组件上下文执行回调。 | CComponent |
| getEventHandlers() | 返回一个事件的附加处理程序列表。 | CComponent |
| hasEvent() | 确定一个事件是否定义。 | CComponent |
| hasEventHandler() | 检查事件是否有附加的处理程序。 | CComponent |
| hasProperty() | 确定属性是否被定义。 | CComponent |
| parseUrl() | Parses a URL based on this rule. | CBaseUrlRule |
| raiseEvent() | 发起一个事件。 | CComponent |
属性详细
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. |
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. |
abstract public function parseUrl($manager,$request,$pathInfo,$rawPathInfo);
Parses a URL based on this rule.