0

如何在下面的代码中覆盖 Zend 验证消息。

$validatee = array(
                        'email' => $email,
                );
        $validator = array(
                    'email' => array(
                                'EmailAddress',
                                'messages' => array('emailAddressInvalidFormat',"Invalid Email Address")
                            )
                    );

        $emailValidator = new Zend_Filter_Input(null, $validator,$validatee);

我试过这样做,但消息没有改变并且总是输出

"no valid email address in the basic format local-part@hostname"

请帮忙!

4

1 回答 1

0

将您的 $validator 更改为 ::

       can you try adding 
$validator = new Zend_Validate_EmailAddress();
$validator->setMessage(
    'A valid email is required',
    Zend_Validate_EmailAddress::INVALID
); 

and then use in Zend_filter_input?
于 2012-06-24T06:54:41.803 回答