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

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

    

kekaadrenalin / yii2-module-recaptcha-v3 example snippets


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


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

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

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

php composer.phar 
index-test.php