Skip to content

Instantly share code, notes, and snippets.

@iign iign/twig-batch.html.twig
Last active May 30, 2017

What would you like to do?
{% set items = ['a', 'b', 'c', 'd', 'e', 'f', 'g'] %}
{% for row in items|batch(3, 'No item') %}
<div class="row">
{% for column in row %}
<div class="element col-xs-4">
{{ column }}
{% endfor %}
{% endfor %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.