Zend_Form -> Nicely change setRequired() validate message

前端 未结 10 1303
死守一世寂寞
死守一世寂寞 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:21

    if you put:

    $element->setRequired(false);
    

    the validations don't work at all, you have to define:

    $element->setAllowEmpty(false);
    

    in order to get the correct behavior of the validations.

提交回复
热议问题