PHP code example of alex290 / yii2-module-recaptcha-v3

1. Go to this page and download the library: Download alex290/yii2-module-recaptcha-v3 library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

alex290 / yii2-module-recaptcha-v3 example snippets


'components' => [
    ...
    'reCaptcha3' => [
        'class'      => 'alex290\recaptcha3\ReCaptcha',
        'site_key'   => 'site_key_###',
        'secret_key' => 'secret_key_###',
    ],


public $reCaptcha;
 
public function rules()
{
 	return [
 		...
 		 [['reCaptcha'], \alex290\recaptcha3\ReCaptchaValidator::className(), 'acceptance_score' => 0]
 	];
}

<?= $form->field($model, 'reCaptcha')->widget(\alex290\recaptcha3\ReCaptchaWidget::class) 

php composer.phar