diff options
Diffstat (limited to 'vendor/twig/twig/doc/functions/random.rst')
-rw-r--r-- | vendor/twig/twig/doc/functions/random.rst | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/vendor/twig/twig/doc/functions/random.rst b/vendor/twig/twig/doc/functions/random.rst deleted file mode 100644 index a5a916bb..00000000 --- a/vendor/twig/twig/doc/functions/random.rst +++ /dev/null | |||
@@ -1,29 +0,0 @@ | |||
1 | ``random`` | ||
2 | ========== | ||
3 | |||
4 | .. versionadded:: 1.5 | ||
5 | The random function was added in Twig 1.5. | ||
6 | |||
7 | .. versionadded:: 1.6 | ||
8 | String and integer handling was added in Twig 1.6. | ||
9 | |||
10 | The ``random`` function returns a random value depending on the supplied | ||
11 | parameter type: | ||
12 | |||
13 | * a random item from a sequence; | ||
14 | * a random character from a string; | ||
15 | * a random integer between 0 and the integer parameter (inclusive). | ||
16 | |||
17 | .. code-block:: jinja | ||
18 | |||
19 | {{ random(['apple', 'orange', 'citrus']) }} {# example output: orange #} | ||
20 | {{ random('ABC') }} {# example output: C #} | ||
21 | {{ random() }} {# example output: 15386094 (works as native PHP `mt_rand`_ function) #} | ||
22 | {{ random(5) }} {# example output: 3 #} | ||
23 | |||
24 | Arguments | ||
25 | --------- | ||
26 | |||
27 | * ``values``: The values | ||
28 | |||
29 | .. _`mt_rand`: http://php.net/mt_rand | ||