From 843e1f74eea0ebec0d303891e683ea43f0538080 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Wed, 23 May 2012 07:40:44 +0200 Subject: [PATCH] added an example for the loop variable (closes #732) --- doc/tags/for.rst | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) 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 -- 1.7.2.5