Re: [SMARTY] my first plugin! :)

From: Date: Wed, 05 Jun 2002 01:25:46 +0000
Subject: Re: [SMARTY] my first plugin! :)
References: 1 2  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-4590@lists.php.net to get a copy of this message
> On another note, burying sql queries in the templates is a bad idea, > IMHO. It works against the basic principals of separating business logic > from display logic. dumping a few headlines from a news table hardly constitutes "business logic", does it? ;) ... in general, I see your point - I would not use this plugin for any major functionality, but it is handy if you want to quickly pull a headline from a news table. And if you want a bit more separation, you can always drop your SQL query in a config file... > You really want to dig through templates to adjust > sql queries? so allow me to turn your question around: do you really want to dig through lengthy PHP scripts to adjust a tiny SQL query? > Do the sql stuff in your application, let the templates > focus on the display of your content. but that's what I'm doing - it just so happens some of my content (i.e. some news headlines and stuff) is stored in a database. now why should I have to code anything additional in order to pull out those data? with this plugin, I don't have to. admit it, it's great, and you love it! ;)

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