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

And why don't you use it that way ?

Changing component from Captcha to Form as this is a Form-Issue

I want to have the same "structure", but it's not that important.

Zend_Captcha is not a validator.