Re: [SMARTY] nested sections, not displaying

From: Date: Sun, 20 Jul 2003 17:57:06 +0000
Subject: Re: [SMARTY] nested sections, not displaying
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-9934@lists.php.net to get a copy of this message
it should read {$data[x].speaker[y].firstname} and not {$data[x][speaker][y].firstname} since there is not section named "speaker". HTH messju On Sun, Jul 20, 2003 at 10:10:24AM -0700, Chris Hubbard wrote: > All, > I'm confused. > > I've got a nested section. And the data that I expect to see from the > nested section isn't displaying. the firstname and last name are not > displying, but the comma between them is. > > Here's the php code I use to build this part of the array: > case "FirstName": > $arr[$i]["speaker"][$z]["firstname"] = $data; > break; > case "LastName": > $arr[$i]["speaker"][$z]["lastname"] = $data; > break; > > Here's the code from the template: > {section name=x loop=$data} > <tr><td align="center"> > <table border=0 cellpadding=2 cellspacing=0 width="94%"> > <tr><td class="head" > valign="top"><b>{$data[x].title}</b></td></tr> > <tr><td valign="top" class="quote"> > {$data[x].startdate} {if $data[x].enddate} through > {$data[x].enddate}{/if}</td> > </tr> > {if $data[x].speaker} > <tr><td valign="top" class="quote">Speakers:<br> > <table border=0 cellpadding=10 cellspacing=0 width="94%"> > {section name=y loop=$data[x].speaker} > <tr><td> > {$data[x][speaker][y].firstname}, {$data[x][speaker][y].lastname} > </td></tr> > {/section} > </table> > </td></tr> > {/if} > > Here's part of the array from the debug console: > {$data} Array (45) > 32 => Array (10) > id => 722201 > startdate => 20030602 > starttime => 16:00:00 > enddate => 20030602 > endtime => 16:00:00 > timezone => GMT > title => Using Sheep Bladders to Prevent Earthquakes > speaker => Array (1) > 0 => Array (2) > firstname => King > lastname => Arthur > city => Camelot > state => ZX > > Here's what I see on the screen (note the comma): > > Using Sheep Bladders to Prevent Earthquakes > 20030602 through 20030602 > Camelot, ZX > Speakers: > , > > Any suggestions? > > Chris Hubbard > chris@wildcharacters.com > www.wildcharacters.com > 425 481 2020 > > php based web application development > > Y! hoponpopontoponmoponcop@yahoo.com > MSN another_ganesha@hotmail.com > AIM ganeshacph > > > -- > Smarty General Mailing List (http://smarty.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

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