From 73bf7803982ab96ff901b969e8c5f9f1d45aacf0 Mon Sep 17 00:00:00 2001 From: Richard Miller Date: Sun, 16 Sep 2012 22:59:02 +0100 Subject: [PATCH 1/2] Adding info on twig:lint console command --- book/templating.rst | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/book/templating.rst b/book/templating.rst index 7e564a5602e..f370cc41751 100644 --- a/book/templating.rst +++ b/book/templating.rst @@ -1312,6 +1312,23 @@ The variables will only be dumped if Twig's ``debug`` setting (in ``config.yml`` is ``true``. By default this means that the variables will be dumped in the ``dev`` environment but not the ``prod`` environment. +Syntax Checking +--------------- + +You can check for syntax errors in Twig templates using the ``twig:lint`` +console command: + +.. code-block:: bash + + # You can check by filename: + $ php app/console twig:lint src/Acme/ArticleBundle/Resources/views/Article/recentList.html.twig + + # or by directory: + $ php app/console twig:lint src/Acme/ArticleBundle/Resources/views + + # or using the bundle name: + $ php app/console twig:lint @AcmeArticleBundle + Template Formats ---------------- From 396a7a0d0718186e55184bdc9cffa9fc0ea13421 Mon Sep 17 00:00:00 2001 From: Richard Miller Date: Sun, 16 Sep 2012 23:03:39 +0100 Subject: [PATCH 2/2] Adding version info for twig:lint command --- book/templating.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/book/templating.rst b/book/templating.rst index f370cc41751..c0b8d363d74 100644 --- a/book/templating.rst +++ b/book/templating.rst @@ -1315,6 +1315,9 @@ is ``true``. By default this means that the variables will be dumped in the Syntax Checking --------------- +.. versionadded:: 2.1 + The ``twig:lint`` command was added in Symfony 2.1 + You can check for syntax errors in Twig templates using the ``twig:lint`` console command: