1. Go to this page and download the library: Download brussens/yii2-recaptcha 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/ */
brussens / yii2-recaptcha example snippets
$container->setSingleton(\ReCaptcha\ReCaptcha::class, function($container, $params, $config) {
return new \ReCaptcha\ReCaptcha('your secret');
});
$container->set(\brussens\yii2\extensions\recaptcha\Widget::class, function($container, $params, $config) {
return new \brussens\yii2\extensions\recaptcha\Widget('your site key', \Yii::$app->language, $config);
});