From e91965a267e78b8356f1fb0c41677668ad4a5c88 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 5 Jan 2015 14:15:09 +0100 Subject: [PATCH] added an absolute_url() Twig function --- DependencyInjection/Compiler/ExtensionPass.php | 4 ++++ Resources/config/twig.xml | 3 +++ 2 files changed, 7 insertions(+) diff --git a/DependencyInjection/Compiler/ExtensionPass.php b/DependencyInjection/Compiler/ExtensionPass.php index 641c5df1..c4bd1d37 100644 --- a/DependencyInjection/Compiler/ExtensionPass.php +++ b/DependencyInjection/Compiler/ExtensionPass.php @@ -42,5 +42,9 @@ public function process(ContainerBuilder $container) if ($container->has('fragment.handler')) { $container->getDefinition('twig.extension.httpkernel')->addTag('twig.extension'); } + + if ($container->has('request_stack')) { + $container->getDefinition('twig.extension.httpfoundation')->addTag('twig.extension'); + } } } diff --git a/Resources/config/twig.xml b/Resources/config/twig.xml index 4ff841db..139befcc 100644 --- a/Resources/config/twig.xml +++ b/Resources/config/twig.xml @@ -103,6 +103,9 @@ + + +