Using Twig’s ‘filter’ and ‘sort’ Filters

When, like many Shopware developers, you switch from Smarty (Shopware 5) to Twig (Shopware 6), or anyhow you are new to Twig, you should take your time to go through Twig’s excellent documentation https://twig.symfony.com/doc/3.x/ – it’s worth while!

Twig comes with some really nice features that help you to improve readability of your code. Like, did you know, that you can use Twig’s filters not just with variables, but also for functions? One example are the filter and sort functions available with the for function.

Continue reading “Using Twig’s ‘filter’ and ‘sort’ Filters”