dev-master
9999999-devYii2 Google reCaptcha implementation
MIT
The Requires
by Sergey Bogatyrev
extension yii2 widget recaptcha
Yii2 Google reCaptcha implementation
Yii2 Google reCAPTCHA version 2.0 implementation., (*1)
ReCaptcha API version 2.0 docs., (*3)
The preferred way to install this extension is through composer., (*4)
Either run, (*5)
php composer.phar require --prefer-dist tonyaxo/yii2-recaptcha "~1.0"
or add, (*6)
"tonyaxo/yii2-recaptcha": "*"
to the require section of your composer.json
file., (*7)
Once the extension is installed, simply use it in your code by :, (*8)
'components' => [ 'recaptcha' => [ 'class' => 'recaptcha\ReCaptchaComponent', 'siteKey' => 'site_key', 'secretKey' => 'key_secret', ], ];
You can also use this widget in an [[yii\widgets\ActiveForm|ActiveForm]] using the [[yii\widgets\ActiveField::widget()|widget()]] method, for example like this:, (*9)
<?= $form->field($model, 'reCaptcha')->widget(ReCaptcha::class, [ 'id' => 'sign-up-captcha', 'render' => ReCaptcha::RENDER_EXPLICIT, ])->label(false) ?>
Yii2 Google reCaptcha implementation
MIT
extension yii2 widget recaptcha