The EWZRecaptchaBundle provides a reCAPTCHA form field for Symfony. It includes an additional validator.
The following forms are ready to use reCAPTCHA:
- Contact form
- Cancellation form
- Registration forms
- Activate business
You can configure the following reCAPTCHA options in the Back Office:
- theme (light or dark)
- type (audio or image)
- size (normal or compact)
- defer - when present, specifies that the script is executed when the page has finished parsing.
- async - when present, specifies that the script is executed asynchronously as soon as it is available.
Activating reCAPTCHA in forms¶
1. Generate the reCAPTCHA API-Key pair¶
Go to: http://www.google.com/recaptcha/admin and log in.
Register a new domain to get a pair of keys.
2. Configure reCAPTCHA¶
Add the generated keys to
Adding reCAPTCHA to a form¶
To add reCAPTCHA, extend the form entity and type.
Ibexa\Bundle\Commerce\Eshop\Entities\Forms\Types/RegisterBusinessType.php for examples.
When you have extended the form entity and type you must add a parameter to
forms.yml and extend
Eshop/Resources/config/backend/configuration_ezcommerce.yml for examples.