ZF 1.11.2
I've tried most of the syntaxes. They didn't click.
$validators = array('product_name' => array('alnum'));
//...
$input = new Zend_Filter_Input($filters, $validators, $_POST);
How in the world do you set a custom error message for alnum with the syntax above? Using 'messages' => array('Not alnum!!')? Yeah, well... How? I must've tried 100 nested arrays.
Use the built in translator.
For example, configure the translator in your config file to use a simple array
This tells the Translate application resource plugin that you want to
APPLICATION_PATH/langNow, create folders for any languages you want to support. At a minimum, you'll want
application/lang/en. For exampleIn each language folder, create a
translate.phpfile. This file will contain (and return) an array of key / value pairs for each translation. You can find the keys for each validator message in the validator class. Here's an example for the Alnum validatorFor all Zend validators, you can also use the
%value%placeholder in your message, eg