Download the PHP package saeven/zf2-circlical-recaptcha without Composer
On this page you can find all versions of the php package saeven/zf2-circlical-recaptcha. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package zf2-circlical-recaptcha
Easy Google Captcha for Zend Framework 3
Google just rolled out their great new CAPTCHA (fewer angry old people is always great!), and you want to get it into your ZF2/ZF3 project! Please users and management alike with this easy module.
Requirements
Add this line to your composer.json
Then include in your application's module.config.php. The module should now be loaded.
Configuration
Copy circlical.recaptcha.local.php into your config/autoload folder. Open it up, and insert your ReCaptcha keys - you get these from Google's website.
A third parameter is there, to help you work through functional tests (e.g., behat). You could set 'bypass' to be true (don't validate the captcha) based on some fixed environment variable, example:
The fourth is the timeout (in seconds) that you permit between the time the captcha is served, and the time that it is solved.
Templates
You need to add the captcha to your form templates, E.g., using Twig it'd look like:
For now, the g-recaptcha-response is not mutable. The reason being that Google renders it with this name, there's no option to change
Form & InputFilter
If you're unfamiliar with ZF2, here's sample form code that implements the Captcha. There's more than needed, but you can see how the Element is added, and similarly, how the counterpart InputFilter (validator) is added as well.
And here's a sample InputFilter
That's all there is to it! Note the optional no_sitekey
and no_script
options on the form init. These are handy if you are sticking many recaptchas on the same view, but need to dynamically fade them in and out.
All versions of zf2-circlical-recaptcha with dependencies
laminas/laminas-servicemanager Version ^3.0.1
laminas/laminas-inputfilter Version ^2.12.0
laminas/laminas-form Version 3.1.1
laminas/laminas-view Version ^2.14
laminas/laminas-mvc Version ^3.3.0
ext-json Version *