aboutsummaryrefslogtreecommitdiffhomepage
path: root/vendor/twig/twig/doc/filters/sort.rst
blob: 33311528fb2df41b8e0a8ac7154ab841f939502a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
``sort``
========

The ``sort`` filter sorts an array:

.. code-block:: jinja

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

.. note::

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

.. _`asort`: http://php.net/asort