matrozov/yii2-yandex-smart-captcha
最新稳定版本:1.0.0
Composer 安装命令:
composer require matrozov/yii2-yandex-smart-captcha
包简介
Yii2 Yandex Smart Captcha
README 文档
README
Yii2 Yandex Smart Captcha
Adds Yandex Smart Captcha into yii2 project
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist matrozov/yii2-yandex-smart-captcha "*"
or add
"matrozov/yii2-yandex-smart-captcha": "*"
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' => [ ... 'yandexSmartCaptcha' => [ 'class' => 'matrozov\yii2yandexSmartCaptcha\YandexSmartCaptcha', 'serverKey' => 'ysc2_********', 'clientKey' => 'ysc1_********', ],
and in your model
public $yandexSmartCaptcha; public function rules() { return [ ... [['yandexSmartCaptcha'], \matrozov\yii2yandexSmartCaptcha\YandexSmartCaptchaValidator::class], ]; }
<?= $form->field($model, 'yandexSmartCaptcha')->widget(\matrozov\yii2yandexSmartCaptcha\YandexSmartCaptchaWidget::class) ?>
Additional parameters
YandexSmartCaptcha
| Name | Required | Type | Default value | |
|---|---|---|---|---|
| clientKey | + | string | Read more | |
| serverKey | + | string | Read more |
YandexSmartCaptchaValidator
| Name | Required | Type | Default value | Comment |
|---|---|---|---|---|
| host | string | bool | false | Specify host for validate smart captcha response or set true to get host from request Read more |
|
| sendUserIp | bool | true | IP address of the user that originated the request to validate the token. Read more |
YandexSmartCaptchaWidget
| Name | Required | Type | Default value | Comment |
|---|---|---|---|---|
| hl | string | null | null By default language get from app language |
Widget and challenge language. Allowed languages: ru, en, be, kk, tt, uk, uz, tr Read more |
|
| test | bool | false | Running CAPTCHA in test mode. The user will always get a challenge. Use this property for debugging and testing only. Read more |
|
| webView | bool | false | Running CAPTCHA in WebView. You can use it to make user response validation more precise when adding CAPTCHA to mobile apps via WebView. Read more |
|
| invisible | bool | false | Invisible CAPTCHA is a way of connecting the SmartCaptcha widget without the "I’m not a robot" button on the page. Read more |
|
| shieldPosition | string | top-left | Position of the data processing notice section. Allowed positions: top-left, center-left, bottom-left, top-right, center-right, bottom-right Read more |
|
| hideShield | bool | false | Hide the data processing notice section. Read more |
统计信息
- 总下载量: 669
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-11-19