projects
/
yaffs-website
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Minor dependency updates
[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