Skip to content
Snippets Groups Projects
Commit 75c512a6 authored by Daniel Korte's avatar Daniel Korte Committed by Ivan
Browse files

Issue #3324280 by Daniel Korte: Use TwigFilter instead of TwigFunction in...

Issue #3324280 by Daniel Korte: Use TwigFilter instead of TwigFunction in hook_twig_tweak_filters_alter()
parent 6073d18a
Branches
Tags
No related merge requests found
......@@ -7,6 +7,7 @@
use Drupal\Component\Utility\Unicode;
use Drupal\node\NodeInterface;
use Twig\TwigFilter;
use Twig\TwigFunction;
use Twig\TwigTest;
......@@ -45,9 +46,9 @@ function hook_twig_tweak_functions_alter(array &$functions): void {
* Twig filters to alter.
*/
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']);
$filters[] = new TwigFilter('str_pad', 'str_pad');
$filters[] = new TwigFilter('ucfirst', [Unicode::class, 'ucfirst']);
$filters[] = new TwigFilter('lcfirst', [Unicode::class, 'lcfirst']);
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment