我正在尝试将我自己的自定义错误消息设置到我的验证码上,但由于某种原因,它会回显两次。
这是我的验证码:
$captcha = new Zend_Form_Element_Captcha(
'captcha', // This is the name of the input field
array('captcha' => array(
// First the type...
'captcha' => 'Image',
// Length of the word...
'wordLen' => 6,
// Captcha timeout, 5 mins
'timeout' => 300,
// What font to use...
'font' => 'images/captcha/font/arial.ttf',
// URL to the images
'imgUrl' => '/images/captcha',
//alt tag to keep SEO guys happy
'imgAlt' => "Captcha Image - Please verify you're human"
)));
然后设置我自己的错误信息:
$captcha->setErrorMessages(array('badCaptcha' => 'My message here'));
当验证失败时,我得到:
'My message here; My message here'
为什么它会重复错误,我该如何解决?