Skip to content

Commit 73bf780

Browse files
Adding info on twig:lint console command
1 parent 480896e commit 73bf780

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

book/templating.rst

+17
Original file line numberDiff line numberDiff line change
@@ -1312,6 +1312,23 @@ The variables will only be dumped if Twig's ``debug`` setting (in ``config.yml``
13121312
is ``true``. By default this means that the variables will be dumped in the
13131313
``dev`` environment but not the ``prod`` environment.
13141314

1315+
Syntax Checking
1316+
---------------
1317+
1318+
You can check for syntax errors in Twig templates using the ``twig:lint``
1319+
console command:
1320+
1321+
.. code-block:: bash
1322+
1323+
# You can check by filename:
1324+
$ php app/console twig:lint src/Acme/ArticleBundle/Resources/views/Article/recentList.html.twig
1325+
1326+
# or by directory:
1327+
$ php app/console twig:lint src/Acme/ArticleBundle/Resources/views
1328+
1329+
# or using the bundle name:
1330+
$ php app/console twig:lint @AcmeArticleBundle
1331+
13151332
Template Formats
13161333
----------------
13171334

0 commit comments

Comments
 (0)