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

1. Go to this page and download the library: Download rabdavinci/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/ */

    

rabdavinci / yii2-module-recaptcha-v3 example snippets


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


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

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

defined('YII_ENV') or define('YII_ENV', 'test');

php composer.phar 
index-test.php