[twig]
{% include 'foo' with ['foo': 'bar'] %}
- {% set vars as ['foo': 'bar'] %}
+ {% set vars = ['foo': 'bar'] %}
{% include 'foo' with vars %}
>**NOTE**
result to a variable:
[twig]
- {% set name as name|capitalize %}
+ {% set name = name|capitalize %}
{% trans %}
Hello {{ name }}!
The array can contain any number of values:
[twig]
- {% set fruits as ['apple', 'orange', 'citrus'] %}
+ {% set fruits = ['apple', 'orange', 'citrus'] %}
{% for i in 0..10 %}
{{ fruits|cycle(i) }}
[twig]
{{ "Twig<br />" }} {# won't be escaped #}
- {% set text as "Twig<br />" %}
+ {% set text = "Twig<br />" %}
{{ text }} {# will be escaped #}
* Escaping is applied before any other filter is applied (the reasoning