I'm developping a website using symfony framework. Now I'm trying to integrate recaptcha into my form so that I used this EWZRecaptchaBundle.
I hardly could install it using the 1.* version (not the version mentioned in the documentation). I followed the documentation and get the keys from hereand I put as domain :127.0.0.1 since I'm on localhost. Then I changed my formType.php
file like this:
use EWZ\Bundle\RecaptchaBundle\Validator\Constraints as Recaptcha;
class ContactType extends AbstractType
{
/**
* @Recaptcha\True
*/
public $recaptcha;
/**
* @param FormBuilderInterface $builder
* @param array $options
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('name')
->add('email')
->add('subject')
->add('message')
->add('recaptcha', 'ewz_recaptcha')
;
}
and added the recaptcha on my twig file like this:
{% form_theme form 'EWZRecaptchaBundle:Form:ewz_recaptcha_widget.html.twig' %}
{{ form_widget(form.recaptcha, { 'attr': {
'options' : {
'theme': 'light',
'type': 'image'
},
} })
}}
But when I try to display the page I get : The parameter "fr" must be defined.
Looking in the details of the error I found:
at appProdDebugProjectContainer ->getParameter ('fr')
in C:\wamp\www\fstn\vendor\excelwebzone\recaptcha-bundle\EWZ\Bundle\RecaptchaBundle\Form\Type\RecaptchaType.php at line 62 -
$this->publicKey = $container->getParameter('ewz_recaptcha.public_key');
$this->secure = $container->getParameter('ewz_recaptcha.secure');
$this->enabled = $container->getParameter('ewz_recaptcha.enabled');
$this->language = $container->getParameter($container->getParameter('ewz_recaptcha.locale_key'));
}
/**
Is it related to the version of the Recaptcha Bundle that I have installed? how can I fix this?