twig.js
twig.js copied to clipboard
TwigException: Twig.expression.type.array.start cannot follow a Twig.expression.type.variable at template:5 near '[...'
trafficstars
From twig.php: test/Twig/Tests/Fixtures/expressions/array_call.test
Template:
{{ items[items[foo]] }}
Data:
{ foo: 'bar', items: { foo: 'bar', bar: 'foo' } }
Error thrown:
TwigException: Twig.expression.type.array.start cannot follow a Twig.expression.type.variable at template:5 near '[...'
any chance to have this fix?
I don't use Twig.js anymore, so I can't help. Unsubscribing to this issue.
I'm looking into this, but my initial analysis shows that this requires a fairly large structural change to handle the situation laid out here so it may take awhile before a fix is ready.
Anyone stumbling on this, there's the following workaround:
{% set temp = items[foo] %}{{ items[temp] }}