Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion reference/configuration/twig.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
~~~~~~~

Expand Down