I have a controller that passes an array to a twig template, which I want to use in a script written on that page. How would I go about doing that?
I\'ve tried this
First, send the data json encoded from controller and
then in javascript,
var context= JSON.parse('{{ YourArrayFromController|raw}}');