RE: [SMARTY] PHPlib->SMARTY I'm stuck....

From: Date: Fri, 16 Aug 2002 15:19:12 +0000
Subject: RE: [SMARTY] PHPlib->SMARTY I'm stuck....
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-5732@lists.php.net to get a copy of this message
Hmm...my suggestion is to dig into the FastTemplate code and really understand what each variable is, where it comes from, and what it's doing. Once you know that, it should be relatively easy to translate into Smarty with something like: {section name=bull_block loop=bulls} . . . ... href="listadmin.php3?id={$bulls[bull_block].bull_id}" ... . . . {section name=new_iss_block loop=newiss} . . . {/section} {section name=sent_iss_block loop=sentiss} . . . {/section} . . . {/section} Basically, the "name" parameter is your index that's incremented each time through the section, and "loop" is the name of the variable containing an array of associative arrays to display. So, $bulls[0] = array( 'bull_id' => 1, 'rc' => 'foo' ); $bulls[1] = array( 'bull_id' => 2, 'rc' => 'bar' ); etc... or something like that. So, you need to understand what variables go with each item in the bulls, newiss, and sentiss arrays, build the arrays if they aren't already (I've never used FastTemplate, so I don't know), then modify the code to use Smarty array reference syntax (above on the href line). HTH, Gary >-----Original Message----- >From: John Wards [mailto:j.wards@sportnetwork.net] >Sent: Friday, August 16, 2002 9:43 AM >To: gary@loescher.org >Cc: smarty-general@lists.php.net >Subject: Re: [SMARTY] PHPlib->SMARTY I'm stuck.... > > >Sorry, > >Bassically I can't get my head around how to convert >that bit in the >template to smarty. I have been staring at it for a >couple of days now >getting no where....I am unsure how the nested PHPlib >blocks would work >within SMARTY and what I var I shoudl loop on. It >doesn't help that I don't >really know the code I am converting as I didn't write >it, its just been >dumped on me....so I am learning it as I go along > >John >----- Original Message ----- >From: "Gary Loescher" <gary@loescher.org> >To: "John Wards" <j.wards@sportnetwork.net>; ><smarty-general@lists.php.net> >Sent: Friday, August 16, 2002 3:35 PM >Subject: RE: [SMARTY] PHPlib->SMARTY I'm stuck.... > > >> Can you be more specific about what is confusing you? >> You're right about using section (or possibly foreach) >> to do this. What more info do you need? >> >> Gary >> >> >-----Original Message----- >> >From: John Wards [mailto:j.wards@sportnetwork.net] >> >Sent: Friday, August 16, 2002 9:29 AM >> >To: smarty-general@lists.php.net >> >Subject: [SMARTY] PHPlib->SMARTY I'm stuck.... >> > >> > >> >Right I'm just confuzed.... >> > >> >I have this bit of PHPlib code >> > >> > $type = "BulletinBuilder.Free"; >> > $t->set_file("start","start_free.htm"); >> > $t->set_block("start", "bull_block", "bulls"); >> > $t->set_block("bull_block", "new_iss_block", >> > "newiss"); >> > $t->set_block("bull_block", "sent_iss_block", >> > "sentiss"); >> > >> [snip] >> >> -- >> Smarty General Mailing List (http://smarty.php.net/) >> To unsubscribe, visit: http://www.php.net/unsub.php > > >-- >Smarty General Mailing List (http://smarty.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php >

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