simon-dt / gulp-twig

Twig plugin for gulp.js, The streaming build system. Looking for maintainer or collaborators. See wiki
https://github.com/zimmen/gulp-twig/wiki/Looking-for-maintainer-or-collaborator(s)
MIT License
62 stars 33 forks source link

json_encode with constant #40

Open mortensassi opened 7 years ago

mortensassi commented 7 years ago

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?