Filter.php
Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to [email protected] so we can send you a copy immediately.
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Filter
- Version
- $Id: Filter.php 24593 2012-01-05 20:35:02Z matthew $
\Zend_Filter
- Implements
- \Zend_Filter_Interface
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Constants
Properties
Methods


addDefaultNamespaces(array | string $namespace) : null
Adds a new default namespace
Name | Type | Description |
---|---|---|
$namespace | array | string |
Type | Description |
---|---|
null |


addFilter(\Zend_Filter_Interface $filter, string $placement = self::CHAIN_APPEND) : \Zend_Filter
Adds a filter to the chain
Name | Type | Description |
---|---|---|
$filter | \Zend_Filter_Interface | |
$placement | string |
Type | Description |
---|---|
\Zend_Filter | Provides a fluent interface |


appendFilter(\Zend_Filter_Interface $filter) : \Zend_Filter
Add a filter to the end of the chain
Name | Type | Description |
---|---|---|
$filter | \Zend_Filter_Interface |
Type | Description |
---|---|
\Zend_Filter | Provides a fluent interface |


filter(mixed $value) : mixed
Returns $value filtered through each filter in the chain
Filters are run in the order in which they were added to the chain (FIFO)
Name | Type | Description |
---|---|---|
$value | mixed |
Type | Description |
---|---|
mixed |
Exception | Description |
---|---|
\Zend_Filter_Exception | If filtering $value is impossible |


filterStatic(mixed $value, string $classBaseName, array $args = array(), array | string $namespaces = array()) : mixed
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.
Name | Type | Description |
---|---|---|
$value | mixed | |
$classBaseName | string | |
$args | array | OPTIONAL |
$namespaces | array | string | OPTIONAL |
Type | Description |
---|---|
mixed |
Exception | Description |
---|---|
\Zend_Filter_Exception |


get(mixed $value, string $classBaseName, array $args = array(), array | string $namespaces = array()) : mixed
Name | Type | Description |
---|---|---|
$value | mixed | |
$classBaseName | string | |
$args | array | OPTIONAL |
$namespaces | array | string | OPTIONAL |
Type | Description |
---|---|
mixed |
Exception | Description |
---|---|
\Zend_Filter_Exception |
- Deprecated
- See
- \global\Zend_Filter::filterStatic()


getDefaultNamespaces() : array
Returns the set default namespaces
Type | Description |
---|---|
array |


hasDefaultNamespaces() : boolean
Returns true when defaultNamespaces are set
Type | Description |
---|---|
boolean |


prependFilter(\Zend_Filter_Interface $filter) : \Zend_Filter
Add a filter to the start of the chain
Name | Type | Description |
---|---|---|
$filter | \Zend_Filter_Interface |
Type | Description |
---|---|
\Zend_Filter | Provides a fluent interface |