After a user fills in a form but does not fill a required field the form is returned with the element in question with the error message – all the fields previously filled are filled out again but the data being entered has & instead of &.
How does zend populate a form that is submit and returned with user errors. How can i filter/run html_entity_decode on them.
Thanks
You can use
Zend_Filterwith a callback on a particular method to filter your field.From the Zend documentation:
So basically, your element filter would look like this:
$myElement->addFilter('Callback', array('callback' => array($this, 'myFilter')))And in the same class, you can create a method named
myFilter()that takes a$valueparameter.This function can
return html_entity_decode;for example. You could also use an inline function using PHP 5.3+:function($v){return(html_entity_decode($v);)}.