PHP code example of piliugin / yii2-recaptcha3

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

    

piliugin / yii2-recaptcha3 example snippets


'components' => [
    ...
    'recaptcha' => [
        'class' => 'piliugin\recaptcha3\Recaptcha',
        'site_key' => '###',
        'secret_key' => '###',
    ],
    ...

public $captchaToken;
 
public function rules()
{
    return [
        ...
        [
            ['captchaToken'],
            RecaptchaValidator::class,
            'action' => 'yourActionName',
            'acceptanceScore' => 0.4,
        ],
    ];
}

php composer.phar