Zend Framework  1.12
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Attributes | Static Protected Attributes | List of all members
Zend_Filter Class Reference

Public Member Functions

 addFilter (Zend_Filter_Interface $filter, $placement=self::CHAIN_APPEND)
 Adds a filter to the chain.
 
 appendFilter (Zend_Filter_Interface $filter)
 Add a filter to the end of the chain.
 
 prependFilter (Zend_Filter_Interface $filter)
 Add a filter to the start of the chain.
 
 getFilters ()
 Get all the filters.
 
 filter ($value)
 Returns $value filtered through each filter in the chain.
 

Static Public Member Functions

static getDefaultNamespaces ()
 Returns the set default namespaces.
 
static setDefaultNamespaces ($namespace)
 Sets new default namespaces.
 
static addDefaultNamespaces ($namespace)
 Adds a new default namespace.
 
static hasDefaultNamespaces ()
 Returns true when defaultNamespaces are set.
 
static get ($value, $classBaseName, array $args=array(), $namespaces=array())
 
static filterStatic ($value, $classBaseName, array $args=array(), $namespaces=array())
 Returns a value filtered through a specified filter class, without requiring separate instantiation of the filter object.
 

Public Attributes

const CHAIN_APPEND = 'append'
 
const CHAIN_PREPEND = 'prepend'
 

Protected Attributes

 $_filters = array()
 

Static Protected Attributes

static $_defaultNamespaces = array()
 

Member Function Documentation

static addDefaultNamespaces (   $namespace)
static

Adds a new default namespace.

Parameters
array | string$namespace
Returns
null
addFilter ( Zend_Filter_Interface  $filter,
  $placement = self::CHAIN_APPEND 
)

Adds a filter to the chain.

Parameters
Zend_Filter_Interface$filter
string$placement
Returns
Zend_Filter Provides a fluent interface
appendFilter ( Zend_Filter_Interface  $filter)

Add a filter to the end of the chain.

Parameters
Zend_Filter_Interface$filter
Returns
Zend_Filter Provides a fluent interface
filter (   $value)

Returns $value filtered through each filter in the chain.

Filters are run in the order in which they were added to the chain (FIFO)

Parameters
mixed$value
Returns
mixed

Implements Zend_Filter_Interface.

static filterStatic (   $value,
  $classBaseName,
array  $args = array(),
  $namespaces = array() 
)
static

Returns a value filtered through a specified filter class, without requiring separate instantiation of the filter object.

The first argument of this method is a data input value, that you would have filtered. The second argument is a string, which corresponds to the basename of the filter class, relative to the Zend_Filter namespace. This method automatically loads the class, creates an instance, and applies the filter() method to the data input. You can also pass an array of constructor arguments, if they are needed for the filter class.

Parameters
mixed$value
string$classBaseName
array$argsOPTIONAL
array | string$namespacesOPTIONAL
Returns
mixed
Exceptions
Zend_Filter_Exception
static get (   $value,
  $classBaseName,
array  $args = array(),
  $namespaces = array() 
)
static
Deprecated:
See Also
Zend_Filter::filterStatic()
Parameters
mixed$value
string$classBaseName
array$argsOPTIONAL
array | string$namespacesOPTIONAL
Returns
mixed
Exceptions
Zend_Filter_Exception
static getDefaultNamespaces ( )
static

Returns the set default namespaces.

Returns
array
getFilters ( )

Get all the filters.

Returns
array
static hasDefaultNamespaces ( )
static

Returns true when defaultNamespaces are set.

Returns
boolean
prependFilter ( Zend_Filter_Interface  $filter)

Add a filter to the start of the chain.

Parameters
Zend_Filter_Interface$filter
Returns
Zend_Filter Provides a fluent interface
static setDefaultNamespaces (   $namespace)
static

Sets new default namespaces.

Parameters
array | string$namespace
Returns
null

Member Data Documentation

$_defaultNamespaces = array()
staticprotected
$_filters = array()
protected
const CHAIN_APPEND = 'append'
const CHAIN_PREPEND = 'prepend'