From 8c5f22b3e69142381f9d84dfb4adafab46eb8c1e Mon Sep 17 00:00:00 2001 From: Quentin Devos <4972091+Okhoshi@users.noreply.github.com> Date: Sat, 10 May 2025 13:25:03 +0200 Subject: [PATCH] [TwigBundle] Describe the new behaviour of twig.cache config Signed-off-by: Quentin Devos <4972091+Okhoshi@users.noreply.github.com> --- reference/configuration/twig.rst | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/reference/configuration/twig.rst b/reference/configuration/twig.rst index 3c4dc1b30ac..13d0463970a 100644 --- a/reference/configuration/twig.rst +++ b/reference/configuration/twig.rst @@ -71,7 +71,7 @@ application harder to maintain. cache ~~~~~ -**type**: ``string`` | ``false`` **default**: ``%kernel.cache_dir%/twig`` +**type**: ``string`` | ``boolean`` **default**: ``true`` Before using the Twig templates to render some contents, they are compiled into regular PHP code. Compilation is a costly process, so the result is cached in @@ -82,6 +82,16 @@ is not recommended; not even in the ``dev`` environment, because the ``auto_reload`` option ensures that cached templates which have changed get compiled again. +Specify the path where the cache should be stored. If set to ``true``, the cache +defaults to ``%kernel.cache_dir%/twig``. However, if the ``auto_reload`` option is +disabled and ``%kernel.build_dir%`` is different from ``%kernel.cache_dir%``, +the cache will instead be stored in ``%kernel.build_dir%/twig``. + +.. versionadded:: 7.3 + + Support for ``true`` value was added in Symfony 7.3, and it became the default + value for this option instead of ``%kernel.cache_dir%/twig``. + charset ~~~~~~~