RE: [SMARTY] Newbie question

From: Date: Fri, 10 Jan 2003 21:13:41 +0000
Subject: RE: [SMARTY] Newbie question
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-7122@lists.php.net to get a copy of this message
Actually, I need to avoid using code in my templates because our graphic designer here only works with WYSIWYG editors and he is afraid of any code (including HTML codes). *sigh* ;) -----Original Message----- From: Darryl Bleau [mailto:darrylbleau@submersion.com] Sent: 10 janvier, 2003 16:11 To: smarty-general@lists.php.net Subject: Re: [SMARTY] Newbie question You might also want to take a look at doing this in a more 'smarty' style, using sections. Something like: Index.php (loop code) array_push($db_rows, $myrow[0]); (end loop) $smarty->assign("LoopRows",$db_rows); index.tpl (extra stuff ...) <Table> {section name=loopme loop=$LoopRows} <tr><td>$LoopRows[loopme]</td></tr> {/section} </Table> > Index.php > (code that retrieves a mysql recordset and loops through the records) > $html_result .= "<TR><TD>".$myrow[0]."</TD></TR>"; > (end of looping) > > if ($html_result = "") > { > $html_result = "{#nodata#}"; > } > > $smarty->assign("htmlResult", $html_result); > $smarty->assign("languagefile", "en.txt"); > $smarty->display("index.tpl"); > > index.tpl > {config_load file=$languagefile} > <HTML> > <BODY> > <TABLE> > {$htmlResult} > </TABLE> > </HTML> -- Smarty General Mailing List (http://smarty.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

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