Re: [SMARTY-DEV] Re: Smarty??
| From: | Justin Patrin | Date: | Fri, 23 Jan 2004 23:41:34 +0000 |
| Subject: | Re: [SMARTY-DEV] Re: Smarty?? | ||
| References: | 1 2 3 4 | Groups: | php.smarty.dev |
| Request: | Send a blank email to php-smarty-dev+get-2065@lists.php.net to get a copy of this message | ||
Monte Ohrt wrote:
Ah, now that I read the whole thing again... The Smarty philosophy is about separating business logic from presentation logic. Meaning, there can be logic in the templates so long as it is for presentation only. This does not imply that there is a force of separation of business logic from presentation logic, Smarty has no knowledge of the difference between them. If you put business logic in the template, that is your own doing. This also does not mean you _must_ have logic in the templates. You can omit all logic and reduce the templates to just text and variables if you so desire.Perfectly true. Smarty makes is easy to seperate the view (HTML) from the rest of the program. I use Smarty myself and it's very useful. I do use login in the templates, but it's mostly for things like looping through an array and outputting it as a table. Theoretically this could all be done outside of smarty with a smarty teplate being called for *each* part of the array, but that would mean that you would have to have a seperate smarty file for each one of those sections and that won't buy you much. Here's the short version. Use it right and it helps you oh so much. -- paperCrane <Justin Patrin>