PHP code example of browserlife / zf2-recaptcha

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

    

browserlife / zf2-recaptcha example snippets


    return array(
        'modules' => array(
            // ...
            'BrlReCaptcha',
        ),
        // ...
    );
    
bash
php composer.phar update

$element = new \Zend\Captcha\Captcha('g-recaptcha-response');
$element->setCaptcha(new BrlReCaptcha\ReCaptcha(array('private_key' => 'YOUR_SECRET FROM GOOGLE', 'public_key' => 'YOUR_PUBLIC_KEY', 'theme' => 'dark')));
$form->add($element);