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

json_encode with constant #40

Open
mortensassi opened this issue Aug 15, 2017 · 0 comments
Open

json_encode with constant #40

mortensassi opened this issue Aug 15, 2017 · 0 comments

Comments

@mortensassi
Copy link

mortensassi commented Aug 15, 2017

When i try to use {{ dump(jsonData|json_encode(constant('JSON_UNESCAPED_SLASHES'))) }} to encode escaped html tags and special characters in my json-string but i'm always getting an error: TwigException: constant function does not exist and is not defined in the context

Also {% autoescape %} does not work: TwigException: Unable to parse 'autoescape'

Any suggestions in how to get twig to encode the json correctly?

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

1 participant