1

If you have a custom module/plugin, you can register a Twig extension, and then your class would look something like this: <?php namespace my\plugin\twigextensions; use Twig\Extension\AbstractExtension; use Twig\TwigFilter; use Twig\TwigFunction; class MyTwigExtension extends AbstractExtension { /** * @inheritdoc */ public function ...


Only top voted, non community-wiki answers of a minimum length are eligible