Class yii\base\InlineAction

继承yii\base\InlineAction » yii\base\Action » yii\base\Component » yii\base\BaseObject
实现yii\base\Configurable
可用自版本2.0
源代码 https://github.com/yiisoft/yii2/blob/master/framework/base/InlineAction.php

InlineAction represents an action that is defined as a controller method.

The name of the controller method is available via $actionMethod which is set by the $controller who creates this action.

For more details and usage information on InlineAction, see the guide article on actions.

公共属性

隐藏继承的属性

属性类型描述定义在
$actionMethod string The controller method that this inline action is associated with yii\base\InlineAction
$behaviors yii\base\Behavior[] 附加到此组件的行为列表. yii\base\Component
$controller yii\base\Controller|yii\web\Controller|yii\console\Controller The controller that owns this action yii\base\Action
$id string ID of the action yii\base\Action
$uniqueId string The unique ID of this action among the whole application. yii\base\Action

公共方法

隐藏继承的方法

方法描述定义在
__call() 调用不是类方法的已命名方法. yii\base\BaseObject
__clone() 在通过克隆现有对象创建对象之后调用此方法. yii\base\Component
__construct() yii\base\InlineAction
__get() 返回对象属性的值. yii\base\BaseObject
__isset() 检查属性是否已设置, 即已定义且不为null. yii\base\BaseObject
__set() 设置对象属性的值. yii\base\BaseObject
__unset() 将对象属性设置为null. yii\base\BaseObject
attachBehavior() 将行为附加到此组件. yii\base\Component
attachBehaviors() 将行为列表附加到组件. yii\base\Component
behaviors() 返回此组件应该具有的行为列表. yii\base\Component
canGetProperty() 返回一个值, 指示属性是否可读. yii\base\BaseObject
canSetProperty() 返回一个值, 指示属性是否可写. yii\base\BaseObject
className() 返回此类的完全限定名称. yii\base\BaseObject
detachBehavior() 从组件中分离一个行为. yii\base\Component
detachBehaviors() 分离组件中的所有行为. yii\base\Component
ensureBehaviors() 确保在 behaviors() 中声明的行为已附加到此组件. yii\base\Component
getBehavior() 返回指定的行为对象. yii\base\Component
getBehaviors() 返回附加到此组件的所有行为. yii\base\Component
getUniqueId() Returns the unique ID of this action among the whole application. yii\base\Action
hasEventHandlers() 返回一个值, 指示是否有任何处理程序附加到指定的事件. yii\base\Component
hasMethod() 返回一个值, 指示方法是否已定义. yii\base\BaseObject
hasProperty() 返回一个值, 指示属性是否已定义. yii\base\BaseObject
init() 初始化对象. yii\base\BaseObject
off() 从该组件分离现有的事件处理程序. yii\base\Component
on() 将事件处理程序附加到事件. yii\base\Component
runWithParams() Runs this action with the specified parameters. yii\base\InlineAction
trigger() 触发事件. yii\base\Component

受保护的方法

隐藏继承的方法

方法描述定义在
afterRun() This method is called right after run() is executed. yii\base\Action
beforeRun() This method is called right before run() is executed. yii\base\Action

属性详情

$actionMethod public 属性

The controller method that this inline action is associated with

public string $actionMethod null

方法详情

__construct() public 方法

public void __construct ( $id, $controller, $actionMethod, $config = [] )
$id string

The ID of this action

$controller yii\base\Controller

The controller that owns this action

$actionMethod string

The controller method that this inline action is associated with

$config array

Name-value pairs that will be used to initialize the object properties

runWithParams() public 方法

Runs this action with the specified parameters.

This method is mainly invoked by the controller.

public mixed runWithParams ( $params )
$params array

Action parameters

return mixed

The result of the action