3
我正試圖獲得工作在我的表單上的google reCAPTCHA的新「隱形」版本。如何在窗體上實現新的隱形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 - 是的,確實。 – ifusion
我不相信任何reCaptcha模塊目前支持(全新!)隱形模塊。不過,我會建議切換到chillu/silverstripe-recaptcha模塊,因爲它看起來稍微好一點,並且由SilverStripe自己的Chillu擁有。 –