Answers for "1 twig ternary"

PHP
1

twig ternary

/* Twig Ternary */
{{  var == 'value1' ? 'true output' : 'false output' }}
/* Twig If */
{% if var == 'value1' %}
	{{ do_this }}
{% elseif var == 'value2' %}
	{{ do_this }}
{% else %}
	{{ do_this }}
{% endif %}
/* Twig Set Var */ 
{% set var = 'value' %}
Posted by: Guest on August-05-2021

Browse Popular Code Answers by Language