From: Fabien Potencier Date: Wed, 23 May 2012 05:40:44 +0000 (+0200) Subject: added an example for the loop variable (closes #732) X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=843e1f74eea0ebec0d303891e683ea43f0538080;p=web%2Fkonrad%2Ftwig.git added an example for the loop variable (closes #732) --- diff --git a/doc/tags/for.rst b/doc/tags/for.rst index 5a0f354..722861a 100644 --- a/doc/tags/for.rst +++ b/doc/tags/for.rst @@ -68,6 +68,12 @@ Variable Description ``loop.parent`` The parent context ===================== ============================================================= +.. code-block:: jinja + + {% for user in users %} + {{ loop.index }} - {{ user.username }} + {% endfor %} + .. note:: The ``loop.length``, ``loop.revindex``, ``loop.revindex0``, and