From 2928191769fbf095d5000d7f97c7da3b4ad36736 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Sun, 18 Dec 2011 12:16:35 +0100 Subject: [PATCH] added missing documentation for the random function --- doc/functions/index.rst | 1 + doc/functions/random.rst | 11 +++++++++++ 2 files changed, 12 insertions(+), 0 deletions(-) create mode 100644 doc/functions/random.rst diff --git a/doc/functions/index.rst b/doc/functions/index.rst index d3a5feb..5159283 100644 --- a/doc/functions/index.rst +++ b/doc/functions/index.rst @@ -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 index 0000000..4f62f49 --- /dev/null +++ b/doc/functions/random.rst @@ -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']) }} -- 1.7.2.5