sortΒΆ

The sort filter sorts an array:

{% for user in users|sort %}
    ...
{% endfor %}

Note

Internally, Twig uses the PHP asort function to maintain index association.

Previous topic

slice

Next topic

split

This Page