Symfony – how make addition from 2 variable twig

symfonytwig

Anyone knows how to addition two variable in twig I want to do something like:

{{ var1 }} + {{ var2 }}

Best Solution

Just do it inside the {{ }}

{{ var1 + var2 }}

If you want to assign it to some other variable:

{% set foo = var1 + var2 %}
{{ foo }}