Yaffs site version 1.1
[yaffs-website] / vendor / twig / twig / doc / filters / sort.rst
1 ``sort``
2 ========
3
4 The ``sort`` filter sorts an array:
5
6 .. code-block:: jinja
7
8     {% for user in users|sort %}
9         ...
10     {% endfor %}
11
12 .. note::
13
14     Internally, Twig uses the PHP `asort`_ function to maintain index
15     association. It supports Traversable objects by transforming
16     those to arrays.
17
18 .. _`asort`: http://php.net/asort