Zend Framework

Zend_Validate classes should have consistent values for error message constants

Details

  • Type: Improvement Improvement
  • Status: Resolved Resolved
  • Priority: Minor 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

Activity

Hide
Wil Sinclair added a comment -

This issue should have been fixed for the 1.5 release.

Show
Wil Sinclair added a comment - This issue should have been fixed for the 1.5 release.
Hide
Wil Sinclair added a comment -

This doesn't appear to have been fixed in 1.5.0. Please update if this is not correct.

Show
Wil Sinclair added a comment - This doesn't appear to have been fixed in 1.5.0. Please update if this is not correct.
Hide
Andries Seutens added a comment -

This is a duplicate of #ZF-3164

Show
Andries Seutens added a comment - This is a duplicate of #ZF-3164

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved:

Time Tracking

Estimated:
2h
Original Estimate - 2 hours
Remaining:
2h
Remaining Estimate - 2 hours
Logged:
Not Specified
Time Spent - Not Specified