rabdavinci/yii2-module-recaptcha-v3
最新稳定版本:1.0.6
Composer 安装命令:
composer require rabdavinci/yii2-module-recaptcha-v3
包简介
This is reCAPTCHA v3 for Yii2.
关键字:
README 文档
README
Yii2 reCAPTCHA v3
Adds recaptcha-v3 into yii2 project After fork fixed work with AJAX and implemented Global registration
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist rabdavinci/yii2-module-recaptcha-v3 "*"
or add
"rabdavinci/yii2-module-recaptcha-v3": "*"
to the require section of your composer.json file.
Usage
Once the extension is installed, simply use it in your code by :
add this to your components main.php
'components' => [ ... 'reCaptcha3' => [ 'class' => 'rabdavinci\recaptcha3\ReCaptcha', 'site_key' => 'site_key_###', 'secret_key' => 'secret_key_###', ],
and in your model
acceptance_score the minimum score for this request (0.0 - 1.0) or null
public $reCaptcha; public function rules() { return [ ... [['reCaptcha'], \rabdavinci\recaptcha3\ReCaptchaValidator::className(), 'acceptance_score' => 0] ]; }
<?= $form->field($model, 'reCaptcha')->widget(\rabdavinci\recaptcha3\ReCaptchaWidget::class) ?>
For tests
When use YII_ENV_TEST in index-test.php then disabled recaptcha's validate:
defined('YII_ENV') or define('YII_ENV', 'test');
统计信息
- 总下载量: 108
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2023-04-09