【问题标题】:Zend Form ReCaptcha not workingZend Form ReCaptcha 不工作
【发布时间】:2011-04-06 14:43:21
【问题描述】:


我有一个带有 reCaptcha 元素的简单的基于 Zend 的表单: $form = new Zend_Form(); $form->setName('忘记密码') ->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。但我看到的不是这个元素,而是简单的输入文本元素。我做错了什么?
提前谢谢你。对不起我的英语。

【问题讨论】:

  • 尽量不要使用自定义装饰器来判断问题是来自装饰器还是来自Zend_Service_ReCaptcha设置

标签: php zend-framework forms recaptcha


【解决方案1】:

很有帮助:

echo $captcha->getHtml();

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-04-19
    • 2015-09-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多