Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
dadix4 opened this issue Mar 12, 2021 · 1 comment
Open

Comments

@dadix4
Copy link

dadix4 commented Mar 12, 2021

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

@manuxi
Copy link
Contributor

manuxi commented Mar 26, 2021

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants