You are here: Re: [SMARTY] order arrays « Smarty Templates Posts « IT news, forums, messages
Re: [SMARTY] order arrays

Posted by Messju Mohr on 04/18/05 11:42

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация