4 .. versionadded:: 1.12.3
5 The ``batch`` filter was added in Twig 1.12.3.
7 The ``batch`` filter "batches" items by returning a list of lists with the
8 given number of items. A second parameter can be provided and used to fill in
13 {% set items = ['a', 'b', 'c', 'd', 'e', 'f', 'g'] %}
16 {% for row in items|batch(3, 'No item') %}
18 {% for column in row %}
25 The above example will be rendered as:
50 * ``size``: The size of the batch; fractional numbers will be rounded up
51 * ``fill``: Used to fill in missing items