fabpot/Twig — pull request #1004 by Felds (2013-02-21 02:02:57+00:00)
Title: Add "chunk" to core extensions

This update aims to facilitate the grid layout creation using arrays/collections.

### Example:

**data**:

```jinja
{% set images = [
'img1.jpg', 'img2.jpg', 'img3.jpg',
'img4.jpg', 'img5.jpg', 'img6.jpg',
'img7.jpg', 'img8.jpg', 'img9.jpg',
] %}
```

**before *chunk*:**

```jinja

{% for image in images %}

{# note the weird indentation #}
{% if loop.index is divisibleby(3) %}

{% endif %}
{% endfor %}

```

**after *chunk*:**

```jinja
{% for images_row in images|chunk(3) %}

{% for image in images_row %}

{% endfor %}

{% endfor %}
```