function twig_tweak_test_twig_tweak_filters_alter in Twig Tweak 3.1.x
Same name and namespace in other branches
- 3.x tests/twig_tweak_test/twig_tweak_test.module \twig_tweak_test_twig_tweak_filters_alter()
Implements hook_twig_tweak_filters_alter().
File
- tests/
twig_tweak_test/ twig_tweak_test.module, line 91 - Primary module hooks for Twig Tweak test module.
Code
function twig_tweak_test_twig_tweak_filters_alter(array &$filters) {
$filters[] = new TwigFilter('bar', function (string $input) : string {
return str_replace('foo', 'bar', $input);
});
}