diff --git a/src/DependencyInjection/FOSHttpCacheExtension.php b/src/DependencyInjection/FOSHttpCacheExtension.php
index c2e281b3..88303672 100644
--- a/src/DependencyInjection/FOSHttpCacheExtension.php
+++ b/src/DependencyInjection/FOSHttpCacheExtension.php
@@ -30,6 +30,7 @@
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
+use Twig\TwigFunction;
final class FOSHttpCacheExtension extends Extension
{
@@ -531,6 +532,9 @@ private function loadCacheTagging(ContainerBuilder $container, XmlFileLoader $lo
$container->setParameter('fos_http_cache.tag_handler.strict', $config['strict']);
$loader->load('cache_tagging.xml');
+ if (class_exists(TwigFunction::class)) {
+ $loader->load('cache_tagging_twig.xml');
+ }
if (class_exists(Application::class)) {
$loader->load('cache_tagging_commands.xml');
}
diff --git a/src/Resources/config/cache_tagging.xml b/src/Resources/config/cache_tagging.xml
index d537aac1..b23abb88 100644
--- a/src/Resources/config/cache_tagging.xml
+++ b/src/Resources/config/cache_tagging.xml
@@ -21,11 +21,6 @@
-
-
-
-
-
diff --git a/src/Resources/config/cache_tagging_twig.xml b/src/Resources/config/cache_tagging_twig.xml
new file mode 100644
index 00000000..192c85a5
--- /dev/null
+++ b/src/Resources/config/cache_tagging_twig.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+