Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create multi statement instructions in TWIG

Tags:

twig

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
%}
like image 989
Nicolas Avatar asked Sep 17 '25 13:09

Nicolas


1 Answers

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

like image 128
Kevin Robatel Avatar answered Sep 19 '25 07:09

Kevin Robatel