Fabien Potencier 197a3115c7 merged branch Tobion/patch-4 (PR #614)
Commits
-------

a15e8f7 typo again
2561aa2 typo
faa90c9 updated doc for random function
fe66358 added tests for random function
6f5ceee Made the random function more versatile

Discussion
----------

Made the random function more versatile

The point is to meet user expectations and to make it more versatile, so it works under more circumstances.
At the moment the random function does only return the supplied parameter when it's not an array. That is not very useful. With this PR it will behave like

    random() => integer as with mt_rand()
    random(5) => integer between 0 and 5 as with mt_rand(0, 5)
    random('foobar') => random character from 'foobar'
    random(array(...)) => random element

I will add tests and documentation if you accept this PR.

---------------------------------------------------------------------------

by fabpot at 2012-01-26T07:29:35Z

Looks good to me. Can you update the docs and add some unit tests?

---------------------------------------------------------------------------

by Tobion at 2012-01-26T11:50:17Z

ready
2012-01-26 13:24:26 +01:00
2012-01-26 12:48:04 +01:00
2012-01-26 12:48:56 +01:00
2012-01-26 12:19:51 +01:00
2012-01-26 12:45:18 +01:00
2012-01-14 17:17:37 +01:00

Twig, the flexible, fast, and secure template language for PHP

Twig is a template language for PHP, released under the new BSD license (code and documentation).

Twig uses a syntax similar to the Django and Jinja template languages which inspired the Twig runtime environment.

More Information

Read the documentation for more information.

Languages
PHP 99.9%