I’m using Zend_Filter_Input
to validate form data and want to customize the error messages, if a user does not enter a value. It is important that each field gets a different error message.
With Zend Framework 1.8.0 I used the following array for the “validator” parameter of Zend_Filter_Input
:
$validators = array(
'salutation' => array(
new Zend_Validate_NotEmpty(),
Zend_Filter_Input::MESSAGES => array(
Zend_Validate_NotEmpty::IS_EMPTY => "Please enter a salutation"
)
),
/* ... */
);
Since I’ve upgraded to ZF 1.8.4, I always get the default message for empty fields (“You must give a non-empty value for field '%field%'”). Obviously Zend_Filter_Input
does not call the Zend_Validate_NotEmpty
validator anymore, if the field is empty.
Is there a way to change this behavior or another way to get customized “empty” messages for each field?