system system.base system.caching system.caching.dependencies system.collections system.console system.db system.db.ar system.db.schema system.db.schema.mssql system.db.schema.mysql system.db.schema.oci system.db.schema.pgsql system.db.schema.sqlite system.i18n system.i18n.gettext system.logging system.utils system.validators system.web system.web.actions system.web.auth system.web.filters system.web.helpers system.web.renderers system.web.services system.web.widgets system.web.widgets.captcha system.web.widgets.pagers

CFilterChain

system.web.filters
继承 class CFilterChain » CList » CComponent
实现 Countable, ArrayAccess, Traversable, IteratorAggregate
可用自 1.0
版本 $Id$
CFilterChain represents a list of filters being applied to an action.

CFilterChain executes the filter list by run().

公共属性

隐藏继承的属性

属性类型描述被定义在
action CAction the action being filtered by this chain. CFilterChain
controller CController the controller who executes the action. CFilterChain
count integer the number of items in the list CList
filterIndex integer the index of the filter that is to be executed when calling run(). CFilterChain
iterator Iterator Returns an iterator for traversing the items in the list. CList
readOnly boolean whether this list is read-only or not. CList

公共方法

隐藏继承的方法

方法描述被定义在
__call() Calls the named method which is not a class method. CComponent
__construct() Constructor. CFilterChain
__get() Returns a property value, an event handler list or a behavior based on its name. CComponent
__isset() Checks if a property value is null. CComponent
__set() Sets value of a component property. CComponent
__unset() Sets a component property to be null. CComponent
add() Appends an item at the end of the list. CList
asa() Returns the named behavior object. CComponent
attachBehavior() Attaches a behavior to this component. CComponent
attachBehaviors() Attaches a list of behaviors to the component. CComponent
attachEventHandler() Attaches an event handler to an event. CComponent
canGetProperty() Determines whether a property can be read. CComponent
canSetProperty() Determines whether a property can be set. CComponent
clear() Removes all items in the list. CList
contains() CList
copyFrom() Copies iterable data into the list. CList
count() Returns the number of items in the list. CList
create() CFilterChain factory method. CFilterChain
detachBehavior() Detaches a behavior from the component. CComponent
detachBehaviors() Detaches all behaviors from the component. CComponent
detachEventHandler() Detaches an existing event handler. CComponent
disableBehavior() Disables an attached behavior. CComponent
disableBehaviors() Disables all behaviors attached to this component. CComponent
enableBehavior() Enables an attached behavior. CComponent
enableBehaviors() Enables all behaviors attached to this component. CComponent
getCount() CList
getEventHandlers() Returns the list of attached event handlers for an event. CComponent
getIterator() Returns an iterator for traversing the items in the list. CList
getReadOnly() CList
hasEvent() Determines whether an event is defined. CComponent
hasEventHandler() Checks whether the named event has attached handlers. CComponent
hasProperty() Determines whether a property is defined. CComponent
indexOf() CList
insertAt() Inserts an item at the specified position. CFilterChain
itemAt() Returns the item at the specified offset. CList
mergeWith() Merges iterable data into the map. CList
offsetExists() Returns whether there is an item at the specified offset. CList
offsetGet() Returns the item at the specified offset. CList
offsetSet() Sets the item at the specified offset. CList
offsetUnset() Unsets the item at the specified offset. CList
raiseEvent() Raises an event. CComponent
remove() Removes an item from the list. CList
removeAt() Removes an item at the specified position. CList
run() Executes the filter indexed at filterIndex. CFilterChain
toArray() CList

受保护的方法

隐藏继承的方法

方法描述被定义在
setReadOnly() CList

属性详情

action 属性
public CAction $action;

the action being filtered by this chain.

controller 属性
public CController $controller;

the controller who executes the action.

filterIndex 属性
public integer $filterIndex;

the index of the filter that is to be executed when calling run().

方法详情

__construct() 方法
public void __construct(CController $controller, CAction $action)
$controller CController the controller who executes the action.
$action CAction the action being filtered by this chain.

Constructor.

create() 方法
public static void create(CController $controller, CAction $action, array $filters)
$controller CController the controller who executes the action.
$action CAction the action being filtered by this chain.
$filters array list of filters to be applied to the action.

CFilterChain factory method. This method creates a CFilterChain instance.

insertAt() 方法
public void insertAt(integer $index, mixed $item)
$index integer the specified position.
$item mixed new item

Inserts an item at the specified position. This method overrides the parent implementation by adding additional check for the item to be added. In particular, only objects implementing IFilter can be added to the list.

run() 方法
public void run()

Executes the filter indexed at filterIndex. After this method is called, filterIndex will be automatically incremented by one. This method is usually invoked in filters so that the filtering process can continue and the action can be executed.