function hook_twig_tweak_filters_alter in Twig Tweak 3.x
Same name and namespace in other branches
- 3.1.x twig_tweak.api.php \hook_twig_tweak_filters_alter()
Alters Twig Tweak filters.
Parameters
\Twig\TwigFilter[] $filters: Twig filters to alter.
1 function implements hook_twig_tweak_filters_alter()
Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.
- twig_tweak_test_twig_tweak_filters_alter in tests/
twig_tweak_test/ twig_tweak_test.module - Implements hook_twig_tweak_filters_alter().
1 invocation of hook_twig_tweak_filters_alter()
File
- ./
twig_tweak.api.php, line 47 - Hooks specific to the Twig Tweak module.
Code
function hook_twig_tweak_filters_alter(array &$filters) : void {
$filters[] = new TwigFunction('str_pad', 'str_pad');
$filters[] = new TwigFunction('ucfirst', [
Unicode::class,
'ucfirst',
]);
$filters[] = new TwigFunction('lcfirst', [
Unicode::class,
'lcfirst',
]);
}