Re: [SMARTY] Newbie question on iterating through arrays

From: Date: Mon, 27 May 2002 15:07:31 +0000
Subject: Re: [SMARTY] Newbie question on iterating through arrays
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-4403@lists.php.net to get a copy of this message
It depends on what you are trying to achieve, but I find that foreach is the simplest way to iterate through an array in your templates. If you need more functionality, use section. Using include_php is really for something altogether different. Check out the documentation, for details on the features of using section to see if that will work better for your needs than using foreach. Craig On Monday 27 May 2002 09:22 am, Rich Gray wrote: > I'm just starting to play around with Smarty and I want to build a page > from an associative array retrieved from a database... > > What's the general consensus of the best/easiest way to go about it? > > section/foreach/include_php ??? > > TIA > Rich

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