Article:
 |
|
The Dynamic Duo of PEAR::DB and Smarty
|
| Subject: |
|
This is not separating logic from presentation |
| Date: |
|
2003-04-23 17:18:23 |
| From: |
|
anonymous2
|
Response to: This is not separating logic from presentation
|
|
No, you are not getting the point. Any logic flow control should not be in the templates because this simply rules out that majority of the real presentation designers.
If you need to iterate over the same template, like in alternating table row colors, just do it in the programming. That is what programming is meant to be, control the program output logic flow.
Template engines like Smarty that make you handle any logic in the templates are not a great improvement over the traditional PHP programming. They require you to learn a third language that is neither PHP nor HTML.
Properly conceived templates should only contain HTML, placeholders and delimiters, so they can be edited in any HTML editor and any good graphic designer can do his job and not have to learn that third language.
|
Showing messages 1 through 4 of 4.
-
This is not separating logic from presentation
2003-05-06 04:32:20
anonymous2
[View]
-
This is not separating logic from presentation
2003-04-24 09:14:15
anonymous2
[View]
-
This is not separating logic from presentation
2003-06-05 12:40:35
anonymous2
[View]
-
This is not separating logic from presentation
2003-07-10 00:18:36
anonymous2
[View]
If you need to iterate over the same template, like in alternating table row colors, just do it in the programming. That is what programming is meant to be, control the program output logic flow.
However, how should the programmer know which color to iterate over and how to specify it? It's the HTML designers job to say "use color a and b". The programmer tells the designer that this row will be repeated for an unknown number of times and then the HTML designer has to come up with a good representation.
I don't see what's wrong with this.