2latlantik / recaptcha
此包提供与Recaptcha V2的集成或隐形验证
dev-master
2020-02-28 11:41 UTC
Requires
- php: >=5.6 || ^7.0
- google/recaptcha: ^1.2
This package is auto-updated.
Last update: 2024-09-28 22:01:48 UTC
README
此包的目标是在我的表单中通过提交按钮实现Google Recaptcha的功能。我使用的是版本2的Google Recaptcha。
要求
- PHP 5.6或更高版本
- google/recaptcha
安装
使用Composer安装此包
composer 2latlantik/recaptcha
然后您需要在配置文件夹中的bundles.php
文件中注册此包
<?php // in config/bundles.php [ // ... Delatlantik\RecaptchaBundle\RecaptchaBundle::class => ['all' => true], // ... ];
然后您必须设置公共密钥和私有密钥,这是进行验证码验证所必需的
# config/packages/recaptcha.yaml recaptcha: key: public_key secret: private_key
用法
您可以使用Type/RecaptchaSubmitType类在表单中添加一个提交按钮。