PHP code example of nocvp / zf3-php7-recaptcha-v2

1. Go to this page and download the library: Download nocvp/zf3-php7-recaptcha-v2 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/ */

    

nocvp / zf3-php7-recaptcha-v2 example snippets


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

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