8000 Added Best Practice guideline for partials/include · Warxcell/symfony-docs@bbd705d · GitHub
[go: up one dir, main page]

Skip to content

Commit bbd705d

Browse files
timonfweaverryan
authored andcommitted
Added Best Practice guideline for partials/include
1 parent a364651 commit bbd705d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

best_practices/templates.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,15 @@ scattered through lots of bundles.
5353

5454
Use lowercased snake_case for directory and template names.
5555

56+
.. best- 73E4 practice::
57+
58+
Use a prefixed underscore for partial templates in template names.
59+
60+
You often want to reuse template code using the ``include`` function to avoid
61+
redundant code. To determine those partials easily in the filesystem you should
62+
prefix partials and any other template without HTML body or ``extends`` tag
63+
with a single underscore.
64+
5665
Twig Extensions
5766
---------------
5867

0 commit comments

Comments
 (0)
0