Twig: Add support to "switch" function

Can you add support for "switch" functions ?

I added extensions from website

https://packagist.org/packages/buzzingpixel/twig-switch

It' s working but this plugin no support. I have to write all code on and add indent.

 

Please add support to the function and add automatic indent Luke that:

 

{% switch myVar %}
    {% case 'value1' %}
        {# ...code here to run for value1 #}
    {% case 'value2' %}
        {# ...code here to run for value2 #}
    {% default %}
        {# ...code here to run for default when no case matched #}
{% endswitch %}
0

Please sign in to leave a comment.