lundi 30 octobre 2017

Randomize Smarty array in foreach

I am trying to randomize the array 'Small', 'Medium' and 'Large' but do not have the point to implement inside my code.

My foreach code:

{foreach $Item->images as $image}
    {strip}
        <img src="{$image->Small}" />
    {/strip}
{/foreach}

Using {selectRandom(1, 2, 3, ...)} was not the solution. Should I assign at first the arrays and than call them?

Any ideas what else I can use?




Aucun commentaire:

Enregistrer un commentaire