Re: [SMARTY] order arrays
| From: | messju mohr | Date: | Mon, 18 Apr 2005 08:42:26 +0000 |
| Subject: | Re: [SMARTY] order arrays | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-12528@lists.php.net to get a copy of this message | ||
On Mon, Apr 18, 2005 at 02:02:13AM +0200, Roderik Emmerink wrote:
> Hi,
>
> I've got the code:
>
> {foreach item=premiumvermelding_id from=$premiumvermeldingen}
> <htmltags>
> {insert_object id=$premiumvermelding_id}</htmltags>
> {/foreach}
>
> to iterate an array.
> I'd like to randomize the order in which the assigned array is iterated.
> Is this possible with smarty?
write a modifier that shuffles the array. and use it like
{foreach item=premiumvermelding_id from=$premiumvermeldingen|@shuffle}
...
HTH
messju