Issues

ZF-6710: Describe an ability to provide messages array for all specified validator

Issue Type: Docs: Improvement Created: 2009-05-18T06:53:30.000+0000 Last Updated: 2009-05-18T07:20:15.000+0000 Status: Resolved Fix version(s): - 1.8.2 (27/May/09)

Reporter: Alexander Veremyev (alexander) Assignee: Alexander Veremyev (alexander) Tags: - Zend_Filter_Input

Related issues: Attachments:

Description

Describe an ability to provide messages array for all specified validator (without requirements to specify validator index).

So the code:

<pre class="highlight">
$validators = array(
    'month' => array(
        new Zend_Validate_Between(1, 12),
        'messages' => array(
            array(
                Zend_Validate_Between::NOT_BETWEEN =>
                    'Month value %value% must be between ' .
                    '%min% and %max%',
                Zend_Validate_Between::NOT_BETWEEN_STRICT =>
                    'Month value %value% must be strictly between ' .
                    '%min% and %max%'
            )
        )
    )
);

will be transformed to

<pre class="highlight">
$validators = array(
    'month' => array(
        new Zend_Validate_Between(1, 12),
        'messages' => array(
                Zend_Validate_Between::NOT_BETWEEN =>
                    'Month value %value% must be between ' .
                    '%min% and %max%',
                Zend_Validate_Between::NOT_BETWEEN_STRICT =>
                    'Month value %value% must be strictly between ' .
                    '%min% and %max%'
        )
    )
);

Comments

Posted by Alexander Veremyev (alexander) on 2009-05-18T07:20:13.000+0000

Done.

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