kleegroup / google-recaptcha-bundle
Symfony Google Recaptcha Form Type
Installs: 2 837
Dependents: 2
Suggesters: 0
Security: 0
Stars: 6
Watchers: 12
Forks: 2
Open Issues: 1
Type:symfony-bundle
Requires
- php: >=5.5.9
- google/recaptcha: ^1.1.3
- symfony/symfony: ^3.0 | ^4.0
Requires (Dev)
- phpunit/phpunit: ~5.4
- symfony/phpunit-bridge: ^3.0
This package is not auto-updated.
Last update: 2024-11-23 00:05:39 UTC
README
Symfony 3 Bundle for Google Recaptcha with Proxy configuration.
Step 1: Setting up the bundle
1) Add GoogleRecaptchaBundle to your project
composer require kleegroup/google-recaptcha-bundle
2) Enable the bundle
Enable the bundle in the kernel:
// app/AppKernel.php public function registerBundles() { $bundles = array( // ... new KleeGroup\GoogleReCaptchaBundle\GoogleReCaptchaBundle(), ); }
Step 2: Configure the bundle
// config.yml [...] google_re_captcha: site_key: [Google_site_key] secret_key: [Google_secret_key] enabled: true/false ajax: true/false locale_key: [locale_key] http_proxy: host: [IP or hostname] port: [Port]
Step 3: Usage
public function buildForm( FormBuilderInterface $builder, array $options) { [...] $builder ->add('recaptcha', ReCaptchaType::class, [ 'mapped' => false, 'constraints' => [ new ReCaptcha(), ], ] ); [...] }