Yaffs site version 1.1
[yaffs-website] / vendor / twig / twig / doc / filters / sort.rst
diff --git a/vendor/twig/twig/doc/filters/sort.rst b/vendor/twig/twig/doc/filters/sort.rst
new file mode 100644 (file)
index 0000000..350207f
--- /dev/null
@@ -0,0 +1,18 @@
+``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. It supports Traversable objects by transforming
+    those to arrays.
+
+.. _`asort`: http://php.net/asort