1/* Twig Ternary */
2{{ var == 'value1' ? 'true output' : 'false output' }}
3/* Twig If */
4{% if var == 'value1' %}
5 {{ do_this }}
6{% elseif var == 'value2' %}
7 {{ do_this }}
8{% else %}
9 {{ do_this }}
10{% endif %}
11/* Twig Set Var */
12{% set var = 'value' %}
1{{ foo ?: 'no' }} is the same as {{ foo ? foo : 'no' }}
2{{ foo ? 'yes' }} is the same as {{ foo ? 'yes' : '' }}
3