Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c4d0738

Browse filesBrowse files
committed
minor symfony#7844 Explain how to override the default templates directory (javiereguiluz)
This PR was merged into the 2.7 branch. Discussion ---------- Explain how to override the default templates directory This fixes symfony#4714. Commits ------- 10dec72 Explain how to override the default templates directory
2 parents ce275ce + 10dec72 commit c4d0738
Copy full SHA for c4d0738

File tree

Expand file treeCollapse file tree

2 files changed

+20
-0
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+20
-0
lines changed

‎configuration/override_dir_structure.rst

Copy file name to clipboardExpand all lines: configuration/override_dir_structure.rst
+18Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ directory structure is:
1515
│ ├─ cache/
1616
│ ├─ config/
1717
│ ├─ logs/
18+
│ ├─ Resources/
19+
│ │ └─ views/
1820
│ └─ ...
1921
├─ src/
2022
│ └─ ...
@@ -80,6 +82,22 @@ method::
8082

8183
Here you have changed the location of the directory to ``app/{environment}/logs``.
8284

85+
.. _override-templates-dir:
86+
87+
Override the Templates Directory
88+
--------------------------------
89+
90+
If your templates are not stored in the default ``app/Resources/views/``
91+
directory, use the :ref:`twig.paths <config-twig-paths>` configuration option to
92+
define your own templates directory (or directories):
93+
94+
.. code-block:: yaml
95+
96+
# app/config/config.yml
97+
twig:
98+
# ...
99+
paths: ["%kernel.root_dir%/../templates"]
100+
83101
.. _override-web-dir:
84102

85103
Override the ``web`` Directory

‎reference/configuration/twig.rst

Copy file name to clipboardExpand all lines: reference/configuration/twig.rst
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,8 @@ on. Set it to ``0`` to disable all the optimizations. You can even enable or
246246
disable these optimizations selectively, as explained in the Twig documentation
247247
about `the optimizer extension`_.
248248

249+
.. _config-twig-paths:
250+
249251
paths
250252
~~~~~
251253

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.