Zend_Form -> Nicely change setRequired() validate message

前端 未结 10 1329
死守一世寂寞
死守一世寂寞 2021-01-31 09:25

Say I create a text element like this:

$firstName = new Zend_Form_Element_Text(\'firstName\');
$firstName->setRequired(true);

Whats

10条回答
  •  悲&欢浪女
    2021-01-31 10:25

    One small issue. This code:

    $zipCode->setLabel('Postal Code')
            ->addValidator('StringLength', true, array( 5, 5 ) )
            ->addErrorMessage('More than 5')
            ->addValidator('Digits', true)
            ->addErrorMessage('Not a digit');
    

    Will generate both error messages if either validation fails. Isn't is supposed to stop after the first fails?

提交回复
热议问题