ZF-2397: Zend_Validate classes should have consistent values for error message constants
Description
Hector Virgen writes @ fw-mvc:
If it's not too much to ask, can we have some consistency in the values for the constants in the Zend_Validate classes?
Some of them have the class name in the constant value, while others don't.
For example, {{Zend_Validate_StringLength::TOO_LONG}} is {{'stringLengthTooLong'}}, while {{Zend_Validate_Between::NOT_BETWEEN}} is {{'notBetween'}}.
This probably wouldn't be a big issue but when creating validators for {{Zend_Filter_Input}} I find myself having to reference the API often to find the actual constant value when creating custom error messages:
$validators = array(
'search' => array(
'presence' => 'required',
array('StringLength', 2, 96),
'messages' => array(
array(
'stringLengthTooShort' =>
'Your search query must be at least %min% characters in length.',
'stringLengthTooLong' =>
'Your search query may not be greater than %max% characters in length.',
)
)
)
)
Thank you.
Comments
Posted by Wil Sinclair (wil) on 2008-03-21T17:05:30.000+0000
This issue should have been fixed for the 1.5 release.
Posted by Wil Sinclair (wil) on 2008-04-18T13:11:54.000+0000
This doesn't appear to have been fixed in 1.5.0. Please update if this is not correct.
Posted by Andries Seutens (andries) on 2008-11-08T06:48:43.000+0000
This is a duplicate of #ZF-3164