Skip to content

Commit f153ae4

Browse files
committed
Reword
1 parent 754c7ce commit f153ae4

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

reference/configuration/twig.rst

+15-9
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,21 @@ file_name_pattern
173173

174174
**type**: ``string`` or ``array`` of ``string`` **default**: ``[]``
175175

176-
Name pattern of the Twig files in the template directories. The value can be a regexp,
177-
a glob, or a string. This is used by the commands ``lint:twig`` and ``cache:warmup``
178-
to find template files in all the configured paths.
176+
.. versionadded:: 6.1
177+
178+
The ``file_name_pattern`` option was introduced in Symfony 6.1.
179+
180+
Some applications store their front-end assets in the same directory as Twig
181+
templates. The ``lint:twig`` command filters those files to only lint the ones
182+
that match the ``*.twig`` filename pattern.
183+
184+
However, the ``cache:warmup`` command tries to compile all files, including
185+
non-Twig templates (and it ignores compilation errors). The result is an
186+
unnecessary consumption of CPU and disk resources.
187+
188+
In those cases, use this option to define the filename pattern(s) of the files
189+
that are Twig templates (the rest of files will be ignored by ``cache:warmup``).
190+
The value of this option can be a regular expression, a glob, or a string:
179191

180192
.. configuration-block::
181193

@@ -218,12 +230,6 @@ to find template files in all the configured paths.
218230
// ...
219231
};
220232
221-
.. note::
222-
223-
By default, if the option is not set, the lint command filters on ``*.twig`` files.
224-
The cache warmer does not filter on file names and tries to compile all the
225-
files in the template directories; ignoring compilation errors.
226-
227233
.. _config-twig-form-themes:
228234

229235
form_themes

0 commit comments

Comments
 (0)