Zend - 从reCaptcha迁移到reCaptcha2

时间:2018-04-06 21:10:18

标签: php zend-framework recaptcha

我目前在我的网站上有一个使用Zend的Recaptcha表单。我需要在这里更改以实现Recaptcha2?

$reCaptcha = new Zend_Service_ReCaptcha($config->recaptcha->site_key, $config->recaptcha->secret_key);

    $captcha = new Zend_Form_Element_Captcha('captcha',
        array(
            'captcha'       => 'ReCaptcha',
            'captchaOptions' => array(
                'captcha' => 'ReCaptcha',
                'service' => $reCaptcha,
                'messages' => array(
                    'badCaptcha' => $translator->translate('Form-Captcha-InvalidCaptchaValue')
                ),
                'theme' => 'white'
            ),
            'ignore' => true,
        )
    );

Thanksr

0 个答案:

没有答案