Skip to content

Commit a9db208

Browse files
committed
Merge pull request #1719 from richardmiller/adding_info_on_twig_lint
Adding info on twig:lint console command
2 parents 7aa94a2 + 396a7a0 commit a9db208

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

book/templating.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1312,6 +1312,26 @@ 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+
.. versionadded:: 2.1
1319+
The ``twig:lint`` command was added in Symfony 2.1
1320+
1321+
You can check for syntax errors in Twig templates using the ``twig:lint``
1322+
console command:
1323+
1324+
.. code-block:: bash
1325+
1326+
# You can check by filename:
1327+
$ php app/console twig:lint src/Acme/ArticleBundle/Resources/views/Article/recentList.html.twig
1328+
1329+
# or by directory:
1330+
$ php app/console twig:lint src/Acme/ArticleBundle/Resources/views
1331+
1332+
# or using the bundle name:
1333+
$ php app/console twig:lint @AcmeArticleBundle
1334+
13151335
Template Formats
13161336
----------------
13171337

0 commit comments

Comments
 (0)