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_NotEmoty
);

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

However, only field_1 and field_3 exists in the result and are availible for
escaping with the filters (the other fields end up as "unknown") so:

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

Any way around this or have I just misunderstood how to use
Zend_Filter_Input? 

Edit - messed up the formating..
-- 
View this message in context: 
http://www.nabble.com/Zend_Filter_Input-and-unknown-fields-tf4821361s16154.html#a13793444
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to