I posted this to core, but doesn't seem like many are subscribed to that - so
I am trying this list instead. Forgive me if its the wrong list :)

Code:

$input = array('customerId' => 3);

$filters = array(
        'customerId' => 'Digits',
        '*' => array(
                array('Alnum', true),
                'StringTrim'
        )
);
$validators = array(
        '*' => array(
                'allowEmpty' => true
        ),
        'customerId' => array(
                'presence' => 'required',
                array('GreaterThan', 0)
        ),
        'description' => array(
                'presence' => 'required'
        )
);

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

print_r($filteredInput->getErrors());
print_r($filteredInput->getMissing());

I would think that an error about the missing 'description' field would be
contained in the getErrors() method, but it is not. You have to use
getMissing() to find out, which contains a detailed message as opposed to
the shorter error messages available in getErrors(). Is this the correct
behavior??

Thanks-
Patrick Calkins

-- 
View this message in context: 
http://www.nabble.com/Zend_Input_Filter%3A%3AgetErrors%28%29-does-not-inform-of-missing-fields-tf4773581s16154.html#a13655694
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to