filter boolean variable in a twig template

Quick way to achieve that is to use the ternary operator:

{{ bool_var ? 'Yes':'No' }}

http://twig.sensiolabs.org/doc/templates.html#other-operators

You could also create a custom filter that would do this. Read about custom TWIG extensions – http://symfony.com/doc/current/cookbook/templating/twig_extension.html

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)