109
rated 0 times
[
112]
[
3]
/ answers: 1 / hits: 72908
/ 12 Years ago, tue, december 18, 2012, 12:00:00
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 in my .twig template:
<script>
$(document).ready(function(){
var test = {{ testArray }};
});
</script>
but that only works if it's a string.
More From » php