Answers for "break loop twig"

0

twig break

{% set break = false %}
{% for post in posts if not break %}
    <h2>{{ post.heading }}</h2>
    {% if post.id == 10 %}
        {% set break = true %}
    {% endif %}
{% endfor %}
Posted by: Guest on May-28-2020

Browse Popular Code Answers by Language