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
%}
Nicolas
  • 1,320
  • 2
  • 16
  • 28
  • 3
    great question, btw the doc refer, for the [set operator](http://twig.sensiolabs.org/doc/tags/set.html), 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 '15 at 05:22

1 Answers1

1

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

Kevin Robatel
  • 8,025
  • 3
  • 44
  • 57