Issue Details (XML | Word | Printable)

Key: ZF-6710
Type: Docs:  Improvement Docs: Improvement
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Alexander Veremyev
Reporter: Alexander Veremyev
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Google issue summary
Zend Framework

Describe an ability to provide messages array for all specified validator

Created: 18/May/09 06:53 AM   Updated: 18/May/09 07:20 AM   Resolved: 18/May/09 07:20 AM
Component/s: Zend_Filter_Input
Affects Version/s: None
Fix Version/s: 1.8.2

Time Tracking:
Not Specified

Language: English


 Description  « Hide

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

So the code:

$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

$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%'
        )
    )
);


Alexander Veremyev added a comment - 18/May/09 07:20 AM

Done.