【发布时间】:2017-04-04 07:17:42
【问题描述】:
我正在尝试让新的“隐形”版本的 google reCAPTCHA 在我的表单上运行。
我正在使用https://github.com/UndefinedOffset/silverstripe-nocaptcha
根据文档,您应该可以在 config.yml 中进行更改,我认为它是不可见的?
default_size: "invisible"
--
public function HelloForm() {
$fields = new FieldList(
new TextField('Name'),
new EmailField('Email'),
new TextareaField('Message')
);
$actions = new FieldList(
new FormAction('doSubmitHelloForm', 'Submit')
);
$form = new Form($this, 'HelloForm', $fields, $actions);
$form->enableSpamProtection()
->fields()->fieldByName('Captcha')
->setTitle("Spam protection")
->setDescription("Please tick the box to prove you're a human and help us stop spam.");
return $form;
}
config.yml
NocaptchaField:
site_key: "MYKEYINHERE" #Your site key (required)
secret_key: "MYKEYINHERE" #Your secret key (required)
verify_ssl: true #Allows you to disable php-curl's SSL peer verification by setting this to false (optional, defaults to true)
default_theme: "light" #Default theme color (optional, light or dark, defaults to light)
default_type: "image" #Default captcha type (optional, image or audio, defaults to image)
default_size: "invisible" #Default size (optional, normal, compact or invisible, defaults to normal)
proxy_server: "" #Your proxy server address (optional)
proxy_auth: "" #Your proxy server authentication information (optional)
但是验证码仍然显示,我错过了什么吗? (请注意,我只是在本地开发机器 atm 上进行测试)。
【问题讨论】:
-
更改配置后你刷了吗?
-
@RobbieAverill - 是的。
-
我认为目前没有任何 reCaptcha 模块支持(全新的!)隐形模块。但是,我建议切换到 chillu/silverstripe-recaptcha 模块,因为它似乎维护得更好,并且归 SilverStripe 自己的 Chillu 所有。
-
@SimonErkelens the readme 问题中的模块似乎表明它确实支持“不可见”大小
-
我在模块上创建了一个问题单。所以看看作者怎么说。
标签: silverstripe