Re: [SMARTY] while loop in smarty like ...

From: Date: Tue, 19 Aug 2003 21:29:00 +0000
Subject: Re: [SMARTY] while loop in smarty like ...
References: 1 2 3 4  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-10100@lists.php.net to get a copy of this message
messju mohr wrote:
what about this: [in your .php] $links = array(); while($repeat = $iterator->next()) { $links[] = $iterator->next()->getlink(); } $smarty->assign('links', $links); [and in the .tpl] {foreach from=$links item=link} {$link} {/foreach} i think you don't need a custom block here necessarily.
Then i don't need an Iterator over objects. In the Objects there are many usefull functions like getTitle, getReview etc. Without my objectIterator in the template i must assign many template variables. In this case i don't need an Iterator. Because i don't like work with many array, i decided to use an iterator. My Iterator creates the Movie Object in next() function of the Iterator. Thank you for your help. Kai

« previous php.smarty.general (#10100) next »