Merge branch '1.x' into 2.x

* 1.x:
  fixed typo
  update docs for for loop with conditional to reference filter filters
This commit is contained in:
Fabien Potencier
2019-05-17 14:21:07 +02:00
+7
View File
@@ -84,6 +84,13 @@ Variable Description
Adding a condition
------------------
.. tip::
As of Twig 1.41, use the :doc:`filter <../filters/filter>` filter instead,
or an ``if`` condition inside the ``for`` body (if your condition depends on
a variable updated inside the loop and you are not using the ``loop``
variable).
Unlike in PHP, it's not possible to ``break`` or ``continue`` in a loop. You
can however filter the sequence during iteration which allows you to skip
items. The following example skips all the users which are not active: