Re: [SMARTY] nested section?

From: Date: Wed, 12 Feb 2003 03:05:45 +0000
Subject: Re: [SMARTY] nested section?
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-7667@lists.php.net to get a copy of this message
Hi Steve, Off the top of my head, I would say you have to go with foreach http://smarty.php.net/manual/en/language.function.foreach.php since it is not an array indexed from 0. The template would probably look something like this (untested): <table> {foreach from=$region_dealer_data item=dealer_list} <tr><td> {foreach from=$dealer_list item=$dealer} <a href="{$dealer.href}">{$dealer.name}</a><br /> {/foreach} </td></tr> {/foreach} </table> HTH Jason ----- Original Message ----- From: "Steve" <steve@conceptualthink.com> To: <smarty-general@lists.php.net> Sent: Tuesday, February 11, 2003 8:31 PM Subject: [SMARTY] nested section? > Array ( > [region] => Array ( > [dealer] => Array ( > [href] => dealer.php?id=19 > [name] => Alpha Services > ) > > > I have an array that looks like the above. I need to create a template > that lists all dealer names as links placing all dealers from one region > in a container (table cell or div) with the region name above it in the > container. Is it possible to do this with a nested section syntax in > smarty? I've been trying to figure this out but I'm getting nowhere, the > examples I've seen aren't very clear about the sructure of the array > that is used... Can anybody get me going? Thanks, > > Steven > -- > steve@conceptualthink.com > > -- > Smarty General Mailing List (http://smarty.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

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