CInlineAction

优质
小牛编辑
125浏览
2023-12-01
所有包 | 属性 | 方法
system.web.actions
继承class CInlineAction » CAction » CComponent
实现IAction
源自1.0
版本$Id: CInlineAction.php 3137 2011-03-28 11:08:06Z mdomba $
源码framework/web/actions/CInlineAction.php
CInlineAction表示一个被定义在控制器中的动作。

方法名类似于’actionXYZ‘,这里’XYZ‘代表动作名称。

公共属性

隐藏继承属性

属性类型描述定义在
controllerCController拥有这个动作的控制器。CAction
idstring动作的ID。CAction

公共方法

隐藏继承方法

方法描述定义在
__call()如果类中没有调的方法名,则调用这个方法。CComponent
__construct()构造方法。CAction
__get()返回一个属性值、一个事件处理程序列表或一个行为名称。CComponent
__isset()检查一个属性是否为null。CComponent
__set()设置一个组件的属性值。CComponent
__unset()设置一个组件的属性为null。CComponent
asa()返回这个名字的行为对象。CComponent
attachBehavior()附加一个行为到组件。CComponent
attachBehaviors()附加一个行为列表到组件。CComponent
attachEventHandler()为事件附加一个事件处理程序。CComponent
canGetProperty()确定属性是否可读。CComponent
canSetProperty()确定属性是否可写。CComponent
detachBehavior()从组件中分离一个行为。CComponent
detachBehaviors()从组件中分离所有行为。CComponent
detachEventHandler()分离一个存在的事件处理程序。CComponent
disableBehavior()禁用一个附加行为。CComponent
disableBehaviors()禁用组件附加的所有行为。CComponent
enableBehavior()启用一个附加行为。CComponent
enableBehaviors()启用组件附加的所有行为。CComponent
evaluateExpression()计算一个PHP表达式,或根据组件上下文执行回调。CComponent
getController()返回拥有这个动作的控制器。CAction
getEventHandlers()返回一个事件的附加处理程序列表。CComponent
getId()返回动作的ID。CAction
hasEvent()确定一个事件是否定义。CComponent
hasEventHandler()检查事件是否有附加的处理程序。CComponent
hasProperty()确定属性是否被定义。CComponent
raiseEvent()发起一个事件。CComponent
run()执行该动作。CInlineAction
runWithParams()执行带提供的请求的参数的动作。CInlineAction

受保护方法

隐藏继承方法

方法描述定义在
runWithParamsInternal()执行一个带有命名参数的对象的方法。CAction

方法详细

run() 方法
public void run()
源码: framework/web/actions/CInlineAction.php#29 (显示) publicfunctionrun()
{
$method='action'.$this->getId();
$this->getController()->$method();
}

执行该动作。 该动作定义在控制器中被发起。 这个方法需要CAction要求实现的。

runWithParams() 方法 (可用自 v1.1.7)
public boolean runWithParams(array $params)
$paramsarray请求参数(键名=>键值)
{return}boolean命名参数是否有效的
源码: framework/web/actions/CInlineAction.php#42 (显示) publicfunctionrunWithParams($params)
{
$methodName='action'.$this->getId();
$controller=$this->getController();
$method=newReflectionMethod($controller,$methodName);
if($method->getNumberOfParameters()>0)
return$this->runWithParamsInternal($controller,$method,$params);
else
return$controller->$methodName();
}

执行带提供的请求的参数的动作。 这个方法通过CController::runAction()内部调用。