Re: {section} question

From: Date: Wed, 28 Feb 2001 15:38:31 +0000
Subject: Re: {section} question
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-238@lists.php.net to get a copy of this message
Maciek Uhlig wrote: > > > What I'd really like (OT), is the ability of simple fetching data from > database using PEAR database class. SQL queries in the templates... we've been at this crossroads before (Andrei and I), and all I can say is it leads you to begin using the template engine in a way that it was not intended to be used. Smarty's design goals are to separate application logic from display logic, not mix them back together. Logic used to directly affect the display of your content should be done in the template engine. Everything else (logic that changes or accumulates data structures, etc.) should be done in the application. Of course you always run into little things that bend the rules here and there (like math), but only for accomodating display logic. All in all, you have to draw the line somewhere. SQL queries are a definate no-no. If you do that, Smarty begins to become an entirely new programming language masked over top of PHP. Let's keep Smarty's design focus on display logic as close as possible. -- Monte Ohrt <monte@ispi.net> http://www.ispi.net/

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