Open sunil-silumala opened 8 years ago
The bundle does not register an form type name via ->getName() anymore since Symfony switched to FQCN instead.
I dont know how silex is supposed to work around or adapt this change. Could you share the code of your Form?
I had a similar issue,
I fixed it by adding the following in the vendor files
EWZRecaptchaType.php
public function getName()
{
return 'ewz_recaptcha';
}
RecaptchaExtension.php
public function getExtendedType()
{
return FormType::class;
}
I had to adjust the RecaptchaServiceProvider.php as it was causing a conflict with the profiler
// add loader for EWZ Template
if (isset($app['twig'])) {
$app['twig.loader.filesystem'] = $app->share($app->extend('twig.loader.filesystem', function ($loader, $app) {
$path = dirname(__FILE__).'/../Resources/views/Form';
$loader->addPath($path);
return $loader;
}));
$app['twig.form.templates'] = array_merge(
$app['twig.form.templates'],
array('ewz_recaptcha_widget.html.twig')
);
}
I hope this helps :)
after following all the steps , i am still not able to enable captcha. getting and error. InvalidArgumentException in FormRegistry.php line 92: Could not load type "ewz_recaptcha"
below are the silex and recaptcha-bundle verison in composer.json "silex/silex" : "~1.1", "excelwebzone/recaptcha-bundle": "dev-master"