Details
-
Type:
Improvement
-
Status:
Resolved
-
Priority:
Minor
-
Resolution: Duplicate
-
Affects Version/s: 1.0.3
-
Fix Version/s: Next Major Release
-
Component/s: Zend_Validate
-
Labels:None
-
Fix Version Priority:Nice to Have
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.
Issue Links
| This issue is related to: | ||||
| ZF-3164 | Zend_Validate messageTemplate keys are not all unique. |
|
|
|
This issue should have been fixed for the 1.5 release.