Class CFilter
CFilter is the base class for all filters.
A filter can be applied before and after an action is executed. It can modify
the context that the action is to run or decorate the result that the action
generates.
Override CFilter::preFilter()
to specify the filtering logic that should be
applied before the action, and CFilter::postFilter()
for filtering logic after
the action.
-
CComponent
-
CFilter
implements
IFilter
Methods summary
public
|
#
filter( CFilterChain $filterChain )
Performs the filtering. The default implementation is to invoke CFilter::preFilter() and CFilter::postFilter() which are meant to be overridden child
classes. If a child class needs to override this method, make sure it calls
<span class="php-var">$filterChain</span>->run() if
the action should be executed.
Performs the filtering. The default implementation is to invoke CFilter::preFilter() and CFilter::postFilter() which are meant to be overridden child
classes. If a child class needs to override this method, make sure it calls
<span class="php-var">$filterChain</span>->run() if
the action should be executed.
Parameters
- $filterChain
CFilterChain
$filterChain the filter chain that the filter is on.
Implementation of
|
public
|
#
init( )
Initializes the filter. This method is invoked after the filter properties
are initialized and before CFilter::preFilter() is called. You may override this
method to include some initialization logic.
Initializes the filter. This method is invoked after the filter properties
are initialized and before CFilter::preFilter() is called. You may override this
method to include some initialization logic.
Since
1.1.4
|
protected
boolean
|
#
preFilter( CFilterChain $filterChain )
Performs the pre-action filtering.
Performs the pre-action filtering.
Parameters
- $filterChain
CFilterChain
$filterChain the filter chain that the filter is on.
Returns
boolean whether the filtering process should continue and the action should be executed.
|
protected
|
#
postFilter( CFilterChain $filterChain )
Performs the post-action filtering.
Performs the post-action filtering.
Parameters
- $filterChain
CFilterChain
$filterChain the filter chain that the filter is on.
|
Methods inherited from CComponent
__call(),
__get(),
__isset(),
__set(),
__unset(),
asa(),
attachBehavior(),
attachBehaviors(),
attachEventHandler(),
canGetProperty(),
canSetProperty(),
detachBehavior(),
detachBehaviors(),
detachEventHandler(),
disableBehavior(),
disableBehaviors(),
enableBehavior(),
enableBehaviors(),
evaluateExpression(),
getEventHandlers(),
hasEvent(),
hasEventHandler(),
hasProperty(),
raiseEvent()
|