我有一个简单的带有新元素的基于Zend的表单:$form = reCaptcha Zend_Form();$ form ->setName('forgotpassword') ->setMethod('POST');
$public = Lyf_Config::get('recapctha.public');
$private = Lyf_Config::get('recapctha.private');
$recaptcha = new Zend_Service_ReCaptcha($public, $private);
$captcha = new Zend_Form_Element_Captcha('recaptcha',array(
'captcha' => 'ReCaptcha',
'captchaOptions' => array(
'captcha' => 'ReCaptcha',
'service' => $recaptcha
)));
$form->addElements(array($captcha));
$form->setDecorators(array(array('ViewScript', array('viewScript' => 'login/passwordform.phtml', 'escape' => false))));我希望看到这样的元素:http://webmasterblog.com.ua/wp-content/uploads/2009/07/recaptcha-example.gif。但是我看到的不是这个元素,而是简单的input文本元素。我哪里做错了?
提前谢谢你。对不起,我的英语不好。
发布于 2010-12-30 16:13:53
这很有帮助:
echo $captcha->getHtml();https://stackoverflow.com/questions/4530139
复制相似问题