diff --git a/app/Util/Twig.php b/app/Util/Twig.php index ba0f437f8..33a8edbdb 100644 --- a/app/Util/Twig.php +++ b/app/Util/Twig.php @@ -208,6 +208,15 @@ class Twig { 'UTF-8' ))); + $twig->addFunction(new \Twig\TwigFunction('build_url', function (string $base, array $args): string { + $delim = str_contains($base, '?') ? '&' : '?'; + foreach ($args as $k => $v) { + $base .= $delim . $k . '=' . $v; + $delim = '&'; + } + return $base; + })); + $twig->addFunction(new \Twig\TwigFunction('donor_icon', fn($icon) => new \Twig\Markup(image_cache_encode($icon), 'UTF-8'))); $twig->addFunction(new \Twig\TwigFunction('ipaddr', fn(string $ipaddr) => new \Twig\Markup( diff --git a/templates/report_auto/index.twig b/templates/report_auto/index.twig index cd140a5c7..8d177e47b 100644 --- a/templates/report_auto/index.twig +++ b/templates/report_auto/index.twig @@ -11,7 +11,7 @@
Reports by type
Reports by user