mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-12 10:26:32 +00:00
197a3115c7dff5597668d13fc418e1e42d000488
Commits -------a15e8f7typo again2561aa2typofaa90c9updated doc for random functionfe66358added tests for random function6f5ceeeMade 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
…
…
…
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.
Description
Languages
PHP
99.9%