phpzend-frameworkzend-formzend-filter

Zend_Form and Zend_Filter


How to disable filtering in Zend_Form before its re-populating?


Solution

  • You cannot disable them.

    You could do something like:

    $filters = $form->getElementFilters();
    $form->setElementFilters( array() );
    $form->populate($data);
    $form->setElementFilters( $filters );
    

    However, afaik Zend_Form will only filter the values when you get them from the form and not when you populate the form, so the above is pointless. In case you are after the raw values, use

    $form->getUnfilteredValues();