From: Fabien Potencier Date: Sun, 18 Dec 2011 11:16:35 +0000 (+0100) Subject: added missing documentation for the random function X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=2928191769fbf095d5000d7f97c7da3b4ad36736;p=web%2Fkonrad%2Ftwig.git added missing documentation for the random function --- 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']) }}