From c3b9b2b731336ff22edb83e7f2586545da6d9862 Mon Sep 17 00:00:00 2001 From: Laurent VOULLEMIER Date: Thu, 27 Aug 2020 11:55:52 +0200 Subject: [PATCH] Replace overriding twig.paths by twig.default_path --- configuration/override_dir_structure.rst | 12 +++++------- reference/configuration/twig.rst | 2 ++ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/configuration/override_dir_structure.rst b/configuration/override_dir_structure.rst index 16c9a93ef98..38b3a0ab821 100644 --- a/configuration/override_dir_structure.rst +++ b/configuration/override_dir_structure.rst @@ -94,8 +94,8 @@ Override the Templates Directory -------------------------------- If your templates are not stored in the default ``app/Resources/views/`` -directory, use the :ref:`twig.paths ` configuration option to -define your own templates directory (or directories): +directory, use the :ref:`twig.default_path ` configuration option to +define your own templates directory (use :ref:`twig.paths ` for multiple directories): .. configuration-block:: @@ -104,7 +104,7 @@ define your own templates directory (or directories): # app/config/config.yml twig: # ... - paths: ["%kernel.project_dir%/templates"] + default_path: "%kernel.project_dir%/templates" .. code-block:: xml @@ -119,7 +119,7 @@ define your own templates directory (or directories): https://symfony.com/schema/dic/twig/twig-1.0.xsd"> - %kernel.project_dir%/templates + %kernel.project_dir%/templates @@ -128,9 +128,7 @@ define your own templates directory (or directories): // app/config/config.php $container->loadFromExtension('twig', [ - 'paths' => [ - '%kernel.project_dir%/templates', - ], + 'default_path' => '%kernel.project_dir%/templates', ]); .. _override-web-dir: diff --git a/reference/configuration/twig.rst b/reference/configuration/twig.rst index 88229859230..0c115fbd154 100644 --- a/reference/configuration/twig.rst +++ b/reference/configuration/twig.rst @@ -243,6 +243,8 @@ on. Set it to ``0`` to disable all the optimizations. You can even enable or disable these optimizations selectively, as explained in the Twig documentation about `the optimizer extension`_. +.. _config-twig-default-path: + ``default_path`` ~~~~~~~~~~~~~~~~