Download the PHP package lethak/excelwebzonerecaptcha-bundle without Composer
On this page you can find all versions of the php package lethak/excelwebzonerecaptcha-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download lethak/excelwebzonerecaptcha-bundle
More information about lethak/excelwebzonerecaptcha-bundle
Files in lethak/excelwebzonerecaptcha-bundle
Package excelwebzonerecaptcha-bundle
Short Description This bundle provides easy reCAPTCHA form field integration
License MIT
Homepage https://github.com/excelwebzone/EWZRecaptchaBundle
Informations about the package excelwebzonerecaptcha-bundle
EWZRecaptchaBundle
This bundle provides easy reCAPTCHA form field for Symfony.
A bridge for the Silex framework has been implemented too : Jump to documentation.
Installation
Step 1: Use composer and enable Bundle
To install EWZRecaptchaBundle with Composer just type in your terminal:
Now, Composer will automatically download all required files, and install them
for you. All that is left to do is to update your AppKernel.php
file, and
register the new bundle:
Step2: Configure the bundle's
Add the following to your config file:
NOTE: This Bundle lets the client browser choose the secure https or unsecure http API.
If you want to use the language default for the reCAPTCHA the same as the request locale you must activate the resolver (deactivated by default):
You can easily disable reCAPTCHA (for example in a local or test environment):
Or even load reCAPTCHA using Ajax:
You can add HTTP Proxy configuration:
You can remember if the captcha was already validated and not again requiring it for a certain number of time (default: 0):
Congratulations! You're ready!
Basic Usage
When creating a new form class add the following line to create the field:
You can pass extra options to reCAPTCHA with the "attr > options" option:
If you need to configure the language of the captcha depending on your site language (multisite languages) you can pass the language with the "language" option:
To validate the field use:
Another method would consist to pass the validation constraints as an options of your FormType. This way, your data class contains only meaningful properties. If we take the example from above, the buildForm method would look like this. Please note that if you set then the annotation will not work. You have to also set :
The form template resource is now auto registered via an extension of the container. However, you can always implement your own custom form widget.
PHP:
Twig:
If you are not using a form, you can still implement the reCAPTCHA field using JavaScript:
PHP:
Twig:
Customization
If you want to use a custom theme, put your chunk of code before setting the theme:
All versions of excelwebzonerecaptcha-bundle with dependencies
symfony/validator Version ^2.8 || ^3.0
symfony/framework-bundle Version ^2.8 || ^3.0