JMSTwigJsBundle icon indicating copy to clipboard operation
JMSTwigJsBundle copied to clipboard

Calling method within Twig file with two parameters results in a compiled twig template calling with four parameters

Open dane-harnett opened this issue 11 years ago • 0 comments

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.

dane-harnett avatar Oct 29 '13 03:10 dane-harnett