Hi pakmannen,

You can have a look at this issue : http://framework.zend.com/issues/browse/ZF-2128

--
Laurent Melmoux - [EMAIL PROTECTED]



pakmannen a écrit :
Hi all,

Have a question regarding Zend_Filter_Input and unknown fields. Basically, I
have a form with, say, five fields. I want to apply a filter on all of them,
but only need to validate two. I thought I could do something like this:

$filters = array(
    '*' => new Zend_Filter_Trim
);

$validators = array(
    'field_1' => new Zend_Validator_NotEmpty,
    'field_3' => new Zend_Validator_NotEmpty
);

$input = new Zend_Filter_Input($filters, $validators);

However, only field_1 and field_3 exists in the result and are availible for
escaping and has the filter applied, the other fields end up as "unknown".
That is:

$field_1 = $input->field_1; // Escaped and filtered
$field_2 = $input->field_2; // Empty
$field_3 = $input->field_3; // Escaped and filtered etc..

Any way around this or have I just misunderstood how to use
Zend_Filter_Input?
Edit - messed up the formating..


Reply via email to