FamousWhy Editor: Output Filter is a PHP class to filter scalars, arrays and data objects recursively.
Usually you have to call some filter function like htmlspecialchars() to all of your output data (or at least to most of it). With OutputFilter this can be done all at once. It can filter a whole object, that is all of its properties and even all method results like from getter methods. It can also filter all elements of an array and all this is done recursively.
In fact it acts as a wrapper that wraps the original object/array and replaces it. If you need the unfiltered value, you just have to call unfiltered() on it.
Output Filter also provides a wrapper to use with the filters in the Zend Framework (Zend_View) and Smarty template engine.
This PHP class can be used in a simple or extended way.
As a Simple Usage you must first initialize the wrapper with any filter. The package brings some useful filter classes (HtmlEntitiesFilter, Nl2BrFilter, FilterChain) but you can easily implement your own filters or use filters from the Zend_Filter package.
$wrapper = new OutputFilterWrapper(new HtmlEntitiesFilter);
$var may be anything, from a simple scalar value to arrays and objects to even
resources (the latter being untouched). But the wrapper shows its strengths when
used with complex object and array structures.
If you use Output Filter as a extended usage, you can constrain the wrapper to include or exclude certain methods, properties and array keys from being filtered. You can modify these constraints via the getConstraints() method.
By default, the wrapper handles scalars as follows: strings are being wrapped into FilteredScalar objects, whose_toString() method returns the filtered value, whereas integers, booleans and null values are not filtered at all.
It is possible to use multiple wrappers on a variable.
Output Filter is easily integrable into existing frameworks.
The package requires PHP 5.2.5 or later because it relies on the Typesafe Enum package (http://www.phpclasses.org/package/6021). To use the package, just include outputfilter.lib.php (also edit that file to include the Typesafe Enum package properly).
Why is Output Filter famous?
Output Filter is famous because it is a useful PHP class, allowing the users to filter scalars, arrays and data objects recursively
Output Filter 1.0 is a BSD License . Please read this article and discover
what exactly does BSD License mean.
Whether you're happy or not testing and using Output Filter 1.0, be our guest and let's solve all the problems related to this software together. Feel free to use:
Output Filter 1.0 comments section. No registration required! Please respect the general posting rules and do not abuse our system!
We strongly recommend you to use the following download manager, accelerator and duplicate file manager to avoid any downloading problems:NoClone
FamousWhy is not responsible for the content of the publisher's descriptions or user reviews and comments on this site.
All submitted content and ratings become the sole property of FamousWhy and may not be copied without permission.
We also reserve the rights to approve or refuse the written comments posted on FamousWhy within up to 48 hours.