@@ -173,9 +173,21 @@ file_name_pattern
173
173
174
174
**type **: ``string `` or ``array `` of ``string `` **default **: ``[] ``
175
175
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:
179
191
180
192
.. configuration-block ::
181
193
@@ -218,12 +230,6 @@ to find template files in all the configured paths.
218
230
// ...
219
231
};
220
232
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
-
227
233
.. _config-twig-form-themes :
228
234
229
235
form_themes
0 commit comments