dev-master
9999999-devYii2 widget for reCaptcha
The Requires
by Petra Barus
Wallogit.com
2017 © Pedro Peláez
Yii2 widget for reCaptcha
Google reCaptcha widget for Yii2., (*1)
The preferred way to install this extension is through composer., (*3)
Either run, (*4)
php composer.phar require --prefer-dist petrabarus/yii2-recaptcha "*"
or add, (*5)
"petrabarus/yii2-recaptcha": "*"
to the require section of your composer.json file., (*6)
This package require, (*7)
Obtain the credentials in Google reCaptch. After that dd configuration in the params., (*8)
[
'reCaptcha' => [
'siteKey' => 'ABCDEFGHIJKLMN',
'secretKey' => 'ABCDEFGHIJKLMN',
]
]
Make sure the configuration can be accessed via Yii::$app->params['reCaptcha']['siteKey']
and Yii::$app->params['reCaptcha']['secretKey']., (*9)
To use in the active form., (*10)
$form->field($model, 'captcha')->widget(\PetraBarus\Yii2\ReCaptcha\ReCaptcha::class);
To add validator in the rules, (*11)
['captcha', \PetraBarus\Yii2\ReCaptcha\ReCaptchaValidator::class],
Yii2 widget for reCaptcha