added missing documentation for the random function
authorFabien Potencier <fabien.potencier@gmail.com>
Sun, 18 Dec 2011 11:16:35 +0000 (12:16 +0100)
committerFabien Potencier <fabien.potencier@gmail.com>
Sun, 18 Dec 2011 11:16:35 +0000 (12:16 +0100)
doc/functions/index.rst
doc/functions/random.rst [new file with mode: 0644]

index d3a5feb..5159283 100644 (file)
@@ -7,6 +7,7 @@ Functions
     range
     cycle
     constant
+    random
     attribute
     block
     parent
diff --git a/doc/functions/random.rst b/doc/functions/random.rst
new file mode 100644 (file)
index 0000000..4f62f49
--- /dev/null
@@ -0,0 +1,11 @@
+``random``
+==========
+
+.. versionadded:: 1.5
+    The random function was added in Twig 1.5.
+
+The ``random`` function returns a random item from a sequence:
+
+.. code-block:: jinja
+
+    {{ random(['apple', 'orange', 'citrus']) }}