Download the PHP package dmishh/recaptcha-bundle without Composer
On this page you can find all versions of the php package dmishh/recaptcha-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dmishh/recaptcha-bundle
More information about dmishh/recaptcha-bundle
Files in dmishh/recaptcha-bundle
Package recaptcha-bundle
Short Description reCAPTCHA support for Symfony2 with easy-to-use integration to Security Component.
License MIT
Homepage https://github.com/dmishh/RecaptchaBundle
Informations about the package recaptcha-bundle
reCAPTCHA support for Symfony2
Features
- Easy-to-use
- Service-oriented architecture
- Integration into forms
- Integration into Security Component — for protecting login form with reCAPTCHA
- Independent reCAPTCHA API realization (Recaptcher by default)
- Both, PHP and Twig template engines support
Installation using Composer
-
Add the following to your
composer.json
file: -
Update dependencies, run from command line:
- Register the bundle in your
AppKernel.php
file:
Configuration
Your reCAPTCHA's public and private keys that can be found at your recaptcha admin page.
Configure RecaptchaBundle in your config.yml
:
Usage in forms
Add the following line to create the reCAPTCHA field:
You can pass extra options to reCAPTCHA with the widget_options option:
List of valid options:
- theme
- lang
- custom_translations
- custom_theme_widget
- tabindex
Visit Customizing the Look and Feel of reCAPTCHA for the details of customization.
Validation
RecaptchaType
has built-in validator, you don't need to do anything more. Just use it!
But if you need to disable validation for some reasons, then remove existing validator:
Usage in login form
You need to define RecaptchaFormAuthenticationListener
as default listener for form authentication in services.yml
:
Second parameter in setRecaptcha method is used for disabling validator. This might be useful when you need to disable check in dev environment. For example:
Now you need to add recaptcha field to your form. If you are using your own form type, than add recaptcha field to your form as described [above](#Usage in forms).
Otherwise, add those lines to your Controller which renders login form and to corresponding Twig template:
This documentation is based on EWZRecaptchaBundle's docs.
Roadmap
1.0.* (TODO)
- Add docs about manual installation and usage reCAPTCHA with ajax
1.0
- Initial version
All versions of recaptcha-bundle with dependencies
symfony/security Version ~2.1
symfony/form Version ~2.1
symfony/validator Version ~2.1
dmishh/recaptcher Version 1.0.*