ZF-2834: Zend_Form should provide mechanisms for postfiltering
Description
Currently, Zend_Form implements a pre-filter, allowing the ability to normalize or filter data prior to validation to make validations easier and/or more semantically correct.
However, in some cases, it may be useful to have a postfilter as well. For instance, if you were to attach a form to a model as both a validator and a mechanism for rendering the model as a form, you might wish to have a postfilter available for use when injecting the data into the model's storage mechanism (for instance, encoding data as base64 for use with xml-rpc, or passing through a database's quoting mechanisms prior to injection, etc).
I propose such a postfiltering mechanism work in conjunction with validation; it would only be applied after the data has passed validation. Additionally, a mechanism should be in place to filter the data on-demand, and this should be separate from getValue().
Comments
Posted by Wil Sinclair (wil) on 2008-03-21T17:05:33.000+0000
This issue should have been fixed for the 1.5 release.
Posted by Wil Sinclair (wil) on 2008-03-25T20:29:11.000+0000
Please categorize/fix as needed.
Posted by Cristian Bichis (avantis) on 2009-06-02T11:03:58.000+0000
This feature is a nice enhancement.
Currently seems to be more complicated to automated such things for injecting the data into model.
Posted by Matthew Weier O'Phinney (matthew) on 2009-10-15T09:29:03.000+0000
Postponing the issue until 2.0. I'd like to create the ability to create validation/filter/decorator chains as separate objects that you then attach to Zend_Form/Zend_Form_Element. This will make adding postfilters easier.