Is it possible to make an array item required when using Zend_Filter_Input:
$data = array();
$validators = array(
'name' => 'NotEmpty'
);
$filters = array(
'*' => 'StringTrim'
);
$input = new Zend_Filter_Input($filters, $validators, $data);
var_dump($input->isValid());
It returns true, while I expect it to be false.
Any ways of doing that?
UPD:
found it:
$validators = array(
'name' => array(
'NotEmpty',
'presence' => 'required' // <-----
)
);
but for non existing value $input->getErrors(); returns empty array. How to retrieve a proper error message?
Try