Issues

ZF-2397: Zend_Validate classes should have consistent values for error message constants

Issue Type: Improvement Created: 2008-01-08T15:22:18.000+0000 Last Updated: 2008-11-08T06:48:43.000+0000 Status: Resolved Fix version(s): - Next Major Release ()

Reporter: Darby Felton (darby) Assignee: Wil Sinclair (wil) Tags: - Zend_Validate

Related issues: - ZF-3164

Attachments:

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:

<pre class="highlight">
$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

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts