. // }}} /** * GNU social Twig extensions * * @package GNUsocial * @category Twig * * @author Hugo Sales * @copyright 2020-2021 Free Software Foundation, Inc http://www.fsf.org * @license https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later */ namespace App\Twig; use Twig\Extension\AbstractExtension; use Twig\TwigFunction; class Extension extends AbstractExtension { public function getFilters() { return [ // new TwigFilter('foo', [GSRuntime::class, 'foo']), ]; } public function getFunctions() { return [ /** Twig function to output the 'active' class if the current route matches the given route */ new TwigFunction('active', [Runtime::class, 'isCurrentRouteActive']), new TwigFunction('is_route', [Runtime::class, 'isCurrentRoute']), new TwigFunction('get_note_actions', [Runtime::class, 'getNoteActions']), new TwigFunction('get_note_test', [Runtime::class, 'getNoteTest']), new TwigFunction('get_show_styles', [Runtime::class, 'getShowStyles']), new TwigFunction('config', [Runtime::class, 'getConfig']), new TwigFunction('icon', [Runtime::class, 'embedSvgIcon'], ['needs_environment' => true]), ]; } }