JMSTwigJsBundle
JMSTwigJsBundle copied to clipboard
Calling method within Twig file with two parameters results in a compiled twig template calling with four parameters
I am passing an object into my template like such
var obj = { value: 'a', doStuff: function(param1, param2) { ...}};
Twig.render(myTemplate.twig, { data: obj });
{{ data.doStuff('a', 'b') }}
when doing this, the compiled template ends up calling doStuff() with four params like this: [0, 'a', 1, 'b']
Causing the function to fail as the parameters are not as expected.