mardi 7 juillet 2015

TWIG Random Command - On Reload

I'm quite new to php/twig, I have been trying to use the twig 'random' command, an example is the following:

{{ random(['apple', 'orange', 'citrus']) }} {# example output: orange #}

It works first time when I save the file, but I'd like to work every time I reload the page; it only seems to create a new random option when I re-save the file.




Aucun commentaire:

Enregistrer un commentaire