RE: [SMARTY] To who's right is right??

From: Date: Mon, 17 Jun 2002 07:20:12 +0000
Subject: RE: [SMARTY] To who's right is right??
Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-4888@lists.php.net to get a copy of this message
I'd say that the overall principle for using Smarty or any other template engine is "keep it simple"... i.e. keep functionality in the PHP scripts and use a minimum of functions and control statements in your templates. This should keep dependencies between the scripts and the templates at a minimum, and make room for easy changes. In a previous project i worked on for a major danish newspaper i witnessed the result of cluttering templates (Perl templates) with to much functionality - a monster of a setup, where nobody really knew what was going on. -------------------------------------------------------------- Rasmus T. Mohr Direct : +45 36 910 122 Application Developer Mobile : +45 28 731 827 Netpointers Intl. ApS Phone : +45 70 117 117 Vestergade 18 B Fax : +45 70 115 115 1456 Copenhagen K Email : mailto:rmo@netpointers.com Denmark Website : http://www.netpointers.com "Remember that there are no bugs, only undocumented features." -------------------------------------------------------------- > -----Original Message----- > From: Gerard Samuel [mailto:gsam@trini0.org] > Sent: Monday, June 17, 2002 8:24 AM > To: smarty > Subject: [SMARTY] To who's right is right?? > > > Well I finally got my hands dirty with smarty (and using templates at > that) this weekend. > Its was way easier that what I originally thought. > At first, I was using logic within the templates to determine what to > display. > Then I thought to myself, why am I determining what to present in 2 > places (php code & smarty). > > Ex 1 Determining what to display when a user is a registered user. > Ex 2 Run a database loop to fill and array and then do > another loop to > display it in smarty. > > So I went back and redid how things were done and have php > decide what > to display, while > Smarty piece the chunks of template code together to form the > document. > > For example, database loops, as soon as I get the info from the > database, I assign and display it, instead of > going through 2 loops to display content. > > The bottom line, is there a right way or a wrong way to use smarty? > Would I be penalised for not using smarty's logic routines? > As this was my first time ever using a template engine, I > didn't want to > get too deep into it, > and find out that Im doing things the wrong way. > > Thanks for any input you may provide. > > -- > Gerard Samuel > http://www.trini0.org:81/ > http://dev.trini0.org:81/ > > > > -- > Smarty General Mailing List (http://smarty.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > >

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