EWZRecaptchaBundle icon indicating copy to clipboard operation
EWZRecaptchaBundle copied to clipboard

[SF5] An exception has been thrown during the rendering of a template

Open dadix4 opened this issue 4 years ago • 1 comments

hello, I got an error message when I want to integrate javascript. However, I followed the documentation well. I am using symfony 5.2 and the latest version of EWZRecaptchaBundle (dev-master)

An exception has been thrown during the rendering of a template ("Warning: constant(): Couldn't find constant \EWZ\Bundle\RecaptchaBundle\Form\Type\EWZRecaptchaType::RECAPTCHA_API_JS_SERVER").

<script type="text/javascript"> $(document).ready(function() { $.getScript("{{ constant('\\EWZ\\Bundle\\RecaptchaBundle\\Form\\Type\\EWZRecaptchaType::RECAPTCHA_API_JS_SERVER') }}", function() { Recaptcha.create("{{ form.recaptcha.get('public_key') }}", "recaptcha-container", { theme: "clean" }); }); }); </script>

Thanks for your help

dadix4 avatar Mar 12 '21 14:03 dadix4

Seems that the constant was removed three years ago (v1.5.6) and the documentation wasn't updated accordingly. Did you manage to get it to work?

manuxi avatar Mar 26 '21 17:03 manuxi