Skip to content

Fixed the type of the twig.cache config option #10102

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 20, 2018
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
4 changes: 2 additions & 2 deletions reference/configuration/twig.rst
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,13 @@ application harder to maintain.
cache
~~~~~

**type**: ``string`` **default**: ``'%kernel.cache_dir%/twig'``
**type**: ``string`` | ``false`` | ``Twig\Cache\CacheInterface`` **default**: ``'%kernel.cache_dir%/twig'``
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does Twig\Cache\CacheInterface stand for here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An class implementing that interface. I guessed that anyone so advanced (crazy?) to create their own cache implementation would understand it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The point, if I don't miss anything, is that Twig expects an object implementing this interface. Every string will be interpreted as a path. But you cannot pass an object using the semantic configuration.


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
the directory defined by this configuration option.

Set this option to ``null`` to disable Twig template compilation. However, this
Set this option to ``false`` to disable Twig template compilation. However, this
is not recommended; not even in the ``dev`` environment, because the
``auto_reload`` option ensures that cached templates which have changed get
compiled again.
Expand Down