Download the PHP package victor-prdh/recaptcha-bundle without Composer
On this page you can find all versions of the php package victor-prdh/recaptcha-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download victor-prdh/recaptcha-bundle
More information about victor-prdh/recaptcha-bundle
Files in victor-prdh/recaptcha-bundle
Package recaptcha-bundle
Short Description Use Google Recaptcha v2/v3 as form type with Symfony 5.4+
License MIT
Informations about the package recaptcha-bundle
VictorPrdhRecaptchaBundle
Easy implementation of Google Recaptcha with symfony.
Installation
Before starting the bundle installation, you need to register reCAPTCHA keys here.
Use composer to install this bundle.
With Symfony flex
You can quickly configure this bundle by using symfony/flex:
- answer no for
google/recaptcha
- answer yes for
victor-prdh/recaptcha-bundle
If everything is good, you must have the bundle registred in the "bundles.php" file of your config folder ("config/bundles.php"):
Just add it if you dont see this line.
You can directly go to Usage section
Without Symfony flex
If you don't want / you can't use the flex recipe you can create a "recaptcha.yaml" file in your config folder ("config/packages/recaptcha.yaml"):
Once you created this config file, you can go in your ".env" file and add this:
It's time for update the bundle, if you don't do it, your keys will not be used by the bundle.
Usage
Integration in Symfony Form
You have now a "ReCaptchaType" class available for all your forms. You can use it in your FormBuilder like a "TextType" or "PasswordType":
Display error on your Twig view
Once you create the form, you render it as usual with Symfony. You can show it in your twig file like that:
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
If you speak a language without translation, you're help is welcome.
License
All versions of recaptcha-bundle with dependencies
google/recaptcha Version ^1.2
symfony/framework-bundle Version ^5.4|^6.0|^7.0
symfony/form Version ^5.4|^6.0|^7.0
symfony/translation Version ^5.4|^6.0|^7.0
symfony/twig-pack Version ^1.0
symfony/validator Version ^5.4|^6.0|^7.0