ZF-8480: Same structure on validation
Description
Hello,
is it possible to add the validation messages of the captcha to the validators? It looks like this at the moment:
'validators' => array(
array('NotEmpty', true, array(
'messages' => array(
Zend_Validate_NotEmpty::IS_EMPTY => 'not_empty_is_empty',
)
)),
)
/* Somewhere else at the captcha form element (Zend_Form_Element_Captcha) */
'imgUrl' => 'captchas',
'messages' => array(
Zend_Captcha_Word::BAD_CAPTCHA => 'captcha_bad_captcha',
Zend_Captcha_Word::MISSING_VALUE => 'captcha_missing_value',
Zend_Captcha_Word::MISSING_ID => 'captcha_missing_id'
)
but I want to have it like that:
'validators' => array(
array('NotEmpty', true, array(
'messages' => array(
Zend_Validate_NotEmpty::IS_EMPTY => 'not_empty_is_empty',
)
)),
array('Captcha', true, array(
'messages' => array(
Zend_Captcha_Word::BAD_CAPTCHA => 'captcha_bad_captcha',
Zend_Captcha_Word::MISSING_VALUE => 'captcha_missing_value',
Zend_Captcha_Word::MISSING_ID => 'captcha_missing_id'
)
)),
)
Comments
Posted by Thomas Weidner (thomas) on 2009-12-06T07:37:59.000+0000
And why don't you use it that way ?
Posted by Thomas Weidner (thomas) on 2009-12-06T07:38:45.000+0000
Changing component from Captcha to Form as this is a Form-Issue
Posted by PHP4Dev (php4dev) on 2009-12-06T12:02:27.000+0000
I want to have the same "structure", but it's not that important.
Posted by Frank Brückner (frosch) on 2012-07-30T12:37:27.000+0000
Zend_Captcha is not a validator.