From: Raphaƫl Gertz Date: Tue, 7 Sep 2021 04:30:38 +0000 (+0200) Subject: Add download and base64 filters X-Git-Tag: 0.2.0~13 X-Git-Url: https://git.rapsys.eu/packbundle/commitdiff_plain/cbc7e3aeaa0a626e14dab855eb12da175e091ba4 Add download and base64 filters --- diff --git a/Extension/PackExtension.php b/Extension/PackExtension.php index ac0071a..d32f5bf 100644 --- a/Extension/PackExtension.php +++ b/Extension/PackExtension.php @@ -18,6 +18,7 @@ use Twig\Extension\AbstractExtension; use Rapsys\PackBundle\Parser\TokenParser; use Rapsys\PackBundle\RapsysPackBundle; +use Rapsys\PackBundle\Util\IntlUtil; use Rapsys\PackBundle\Util\SluggerUtil; /** @@ -100,7 +101,10 @@ class PackExtension extends AbstractExtension { new \Twig\TwigFilter('slug', [$this->slugger, 'slug']), new \Twig\TwigFilter('intldate', [$this->intl, 'date'], ['needs_environment' => true]), new \Twig\TwigFilter('intlnumber', [$this->intl, 'number']), - new \Twig\TwigFilter('intlcurrency', [$this->intl, 'currency']) + new \Twig\TwigFilter('intlcurrency', [$this->intl, 'currency']), + new \Twig\TwigFilter('download', 'file_get_contents', [false, null]), + new \Twig\TwigFilter('base64_encode', 'base64_encode'), + new \Twig\TwigFilter('base64_decode', 'base64_decode') ]; }