Details
-
Type:
Docs: Improvement
-
Status:
Resolved
-
Priority:
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%'
)
)
);
Done.