3

I wonder if there is a way of creating multi statements in TWIG

Example: two separate statements ...

{% set foo:bar %}
{% set baz:qux %}

into one single statement

{%
    set foo:bar 
    set baz:qux
%}
1
  • 3
    great question, btw the doc refer, for the set operator, that is possible to do this: {% set foo, bar = 'foo', 'bar' %} in the same section the example is that is equivalent to the double code block. So, seem is not possbile...
    – Matteo
    Apr 23, 2015 at 5:22

1 Answer 1

1

No you can't. set is a "tag", all thing after are compiled with the Token Parser for the "tag".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.