とのこと。使えるようになったらありがたいけどね。
参考サイトにサンプルコードがあったので貼っておく。
breakっぽい書き方。
{% set break = false %} {% for post in posts if not break %} <h2>{{ post.heading }}</h2> {% if post.id == 10 %} {% set break = true %} {% endif %} {% endfor %}
continueっぽい書き方。
{% set continue = false %} {% for post in posts %} {% if post.id == 10 %} {% set continue = true %} {% endif %} {% if not continue %} <h2>{{ post.heading }}</h2> {% endif %} {% if continue %} {% set continue = false %} {% endif %} {% endfor %}
参考サイト
php – How can I use break or continue within for loop in Twig template? – Stack Overflow
https://stackoverflow.com/questions/21672796/how-can-i-use-break-or-continue-within-for-loop-in-twig-template