Zend Framework

Describe an ability to provide messages array for all specified validator

Details

  • Type: Docs:  Improvement Docs: Improvement
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 1.8.2
  • Component/s: Zend_Filter_Input
  • Labels:
    None
  • Language:
    English

Description

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

Activity

Hide
Alexander Veremyev added a comment -

Done.

Show
Alexander Veremyev added a comment - Done.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: