services:
rapsys_pack.twig.pack_extension:
- class: Rapsys\PackBundle\Twig\PackExtension
- arguments: [ '@file_locator', '@service_container' ]
- tags: [ twig.extension ]
+ class: Rapsys\PackBundle\Twig\PackExtension
+ arguments: [ '@file_locator', '@service_container', '@assets.packages' ]
+ tags: [ twig.extension ]
+ rapsys_pack.twig.base64:
+ class: Rapsys\PackBundle\Twig\Base64Extension
+ tags: [ twig.extension ]
--- /dev/null
+<?php
+// src/Rapsys/PackBundle/Twig/Base64Extension.php
+namespace Rapsys\PackBundle\Twig;
+
+class Base64Extension extends \Twig_Extension {
+ public function getFilters() {
+ return array(
+ new \Twig_SimpleFilter('base64_encode', 'base64_encode'),
+ new \Twig_SimpleFilter('base64_decode', 'base64_decode')
+ );
+ }
+}