From: mark_story Date: Sat, 7 Apr 2012 13:50:44 +0000 (-0400) Subject: Update docs concerning loop.last. X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=2a7102d05990cf769a0450ee4b6486c676e2c633;p=web%2Fkonrad%2Ftwig.git Update docs concerning loop.last. --- diff --git a/doc/tags/for.rst b/doc/tags/for.rst index 57cbddb..5a0f354 100644 --- a/doc/tags/for.rst +++ b/doc/tags/for.rst @@ -72,7 +72,8 @@ Variable Description The ``loop.length``, ``loop.revindex``, ``loop.revindex0``, and ``loop.last`` variables are only available for PHP arrays, or objects that - implement the ``Countable`` interface. + implement the ``Countable`` interface. They are also not available when + looping with a condition. .. versionadded:: 1.2 The ``if`` modifier support has been added in Twig 1.2. @@ -93,7 +94,8 @@ items. The following example skips all the users which are not active: The advantage is that the special loop variable will count correctly thus not -counting the users not iterated over. +counting the users not iterated over. Keep in mind that properties like +``loop.last`` will not be defined when using loop conditions. .. note::