PHP 클래스 yii\base\ActionFilter

An action filter will participate in the action execution workflow by responding to the beforeAction and afterAction events triggered by modules and controllers. Check implementation of AccessControl, PageCache and HttpCache as examples on how to use it. For more details and usage information on ActionFilter, see the guide article on filters.
부터: 2.0
저자: Qiang Xue ([email protected])
상속: extends Behavior
파일 보기 프로젝트 열기: yiisoft/yii2 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$except list of action IDs that this filter should not apply to.
$only list of action IDs that this filter should apply to. If this property is not set, then the filter applies to all actions, unless they are listed in [[except]]. If an action ID appears in both [[only]] and [[except]], this filter will NOT apply to it. Note that if the filter is attached to a module, the action IDs should also include child module IDs (if any) and controller IDs. Since version 2.0.9 action IDs can be specified as wildcards, e.g. site/*.

공개 메소드들

메소드 설명
afterAction ( Action $action, mixed $result ) : mixed This method is invoked right after an action is executed.
afterFilter ( ActionEvent $event )
attach ( $owner )
beforeAction ( Action $action ) : boolean This method is invoked right before an action is to be executed (after all possible filters.) You may override this method to do last-minute preparation for the action.
beforeFilter ( ActionEvent $event )
detach ( )

보호된 메소드들

메소드 설명
getActionId ( Action $action ) : string Returns an action ID by converting [[Action::$uniqueId]] into an ID relative to the module
isActive ( Action $action ) : boolean Returns a value indicating whether the filter is active for the given action.

메소드 상세

afterAction() 공개 메소드

You may override this method to do some postprocessing for the action.
public afterAction ( Action $action, mixed $result ) : mixed
$action Action the action just executed.
$result mixed the action execution result
리턴 mixed the processed action result.

afterFilter() 공개 메소드

public afterFilter ( ActionEvent $event )
$event ActionEvent

attach() 공개 메소드

public attach ( $owner )

beforeAction() 공개 메소드

This method is invoked right before an action is to be executed (after all possible filters.) You may override this method to do last-minute preparation for the action.
public beforeAction ( Action $action ) : boolean
$action Action the action to be executed.
리턴 boolean whether the action should continue to be executed.

beforeFilter() 공개 메소드

public beforeFilter ( ActionEvent $event )
$event ActionEvent

detach() 공개 메소드

public detach ( )

getActionId() 보호된 메소드

Returns an action ID by converting [[Action::$uniqueId]] into an ID relative to the module
부터: 2.0.7
protected getActionId ( Action $action ) : string
$action Action
리턴 string

isActive() 보호된 메소드

Returns a value indicating whether the filter is active for the given action.
protected isActive ( Action $action ) : boolean
$action Action the action being filtered
리턴 boolean whether the filter is active for the given action.

프로퍼티 상세

$except 공개적으로 프로퍼티

list of action IDs that this filter should not apply to.
또한 보기: only
public $except

$only 공개적으로 프로퍼티

list of action IDs that this filter should apply to. If this property is not set, then the filter applies to all actions, unless they are listed in [[except]]. If an action ID appears in both [[only]] and [[except]], this filter will NOT apply to it. Note that if the filter is attached to a module, the action IDs should also include child module IDs (if any) and controller IDs. Since version 2.0.9 action IDs can be specified as wildcards, e.g. site/*.
또한 보기: except
public $only