Details
-
Type:
Docs: Improvement
-
Status:
Resolved
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 1.0.2
-
Fix Version/s: 1.10.0
-
Component/s: Zend_Filter_Input, Zend_Validate
-
Labels:None
Description
Get error Zend_Validate_Exception: No message template exists for key '' when attempting the intuitive approach:
example:
$validators = array(
'month' => array(
'alpha',
'messages' => 'A month must consist only of letters'
),
'year' => array(
'digits',
'messages' => 'A year must consist only of numbers'
)
);
Closer reading of the docs suggests that the following works:
example:
$validators = array(
'month' => array(
'alpha'
),
'year' => array(
'digits'
),
'messages' => array (
1 => 'A month must consist only of letters',
2 => 'A year must consist only of numbers'
)
);
Also, if this interpretation is correct what approach should one adopt if there is a form field called 'messages'.
Thanks,
Ian Lewis
Please evaluate and categorize/assign as necessary.