mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-16 12:26:30 +00:00
Update docs concerning loop.last.
This commit is contained in:
+4
-2
@@ -72,7 +72,8 @@ Variable Description
|
|||||||
|
|
||||||
The ``loop.length``, ``loop.revindex``, ``loop.revindex0``, and
|
The ``loop.length``, ``loop.revindex``, ``loop.revindex0``, and
|
||||||
``loop.last`` variables are only available for PHP arrays, or objects that
|
``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
|
.. versionadded:: 1.2
|
||||||
The ``if`` modifier support has been added in Twig 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:
|
|||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
The advantage is that the special loop variable will count correctly thus not
|
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::
|
.. note::
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user