zelenin/yii2-recaptcha-widget
最新稳定版本:0.0.1
Composer 安装命令:
composer require zelenin/yii2-recaptcha-widget
包简介
Yii2 reCAPTCHA widget
README 文档
README
Yii2 reCAPTCHA widget
Installation
Composer
The preferred way to install this extension is through Composer.
Either run
php composer.phar require zelenin/yii2-recaptcha-widget "*"
or add
"zelenin/yii2-recaptcha-widget": "*"
to the require section of your composer.json
Usage
Register a new site.
Add captcha attribute to model:
public $captcha;
public function rules()
{
return [
[
'captcha',
'Zelenin\yii\widgets\Recaptcha\validators\RecaptchaValidator',
'secret' => '<your-secret>'
]
];
}
Add field to view:
<?= $form->field($model, 'captcha')->widget('Zelenin\yii\widgets\Recaptcha\widgets\Recaptcha', [
'clientOptions' => [
'data-sitekey' => '<your-sitekey>'
]
]) ?>
Info
Author
Aleksandr Zelenin, e-mail: aleksandr@zelenin.me
统计信息
- 总下载量: 1.75k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 7
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-12-05