Symfony 3 Bundle for Google Recaptcha with Proxy configuration.
composer require kleegroup/google-recaptcha-bundle
Enable the bundle in the kernel:
// app/AppKernel.php
public function registerBundles()
{
$bundles = array(
// ...
new KleeGroup\GoogleReCaptchaBundle\GoogleReCaptchaBundle(),
);
}
// 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]
public function buildForm( FormBuilderInterface $builder, array $options)
{
[...]
$builder
->add('recaptcha', ReCaptchaType::class,
[
'mapped' => false,
'constraints' => [
new ReCaptcha(),
],
]
);
[...]
}