What is the right way to assign a few validators to the same data field when using Zend_Input_Filter.
E.g. my validators array is this and I need to validations on Field2:
$validators = array(
'Field1' => array(
'NotEmpty',
'messages' => 'Field1 must be filled'
),
'Feild2' => array(
'NotEmpty',
'messages' => 'Field2 must be selected'
),
'Field2' => array(
'Digits',
'messages' => 'Field2 must be numeric'
),
);
Then I call
$input = new Zend_Filter_Input(null, $validators, $data);
But I guess I can't use array key 'Field2' twise. Then how to I bind to validators to just 1 field?
P.S. Well, I know the hard way is to stuff all field validators into one class, but I hope there is and easy ZF way, the configuration way.