| Article: |
The Dynamic Duo of PEAR::DB and Smarty | |
| Subject: | This is not separating logic from presentation | |
| Date: | 2003-04-22 22:22:07 | |
| From: | anonymous2 | |
|
When you still have logic expressions in the HTML, this is not separating logic from presentation.
|
||
Showing messages 1 through 2 of 2.
-
This is not separating logic from presentation
2003-04-23 19:59:26 jcpm [View]
-
This is not separating logic from presentation
2003-04-23 10:09:22 anonymous2 [View]
There is more than one type of logic. The idea behind templates is to remove business logic from your presentation. Not to remove presentation logic from your presentation. There is a bunch of logic that has every right to be in the templates - such as alternating table row colors, theme selection, special messages, etc. This has nothing to do with the business logic or data access. Try this:
http://www.massassi.com/php/template_engines/



From personal experience, having presentation logic in the PHP code eventually gets confusing and messy. Why should I have to loop through blocks as it is done in PHPLIB just to set a placeholder to have the color #CCCCCC or #999999.
But most of all, this is personal opinion. Templating systems should be chosen by what you feel comfortable using, and some people may prefer Smarty and some people may prefer PHPLIB or some other system.
Cheers,
Joao Prado Maia