Re: [SMARTY] To who's right is right??
| From: | Gerard Samuel | Date: | Mon, 17 Jun 2002 21:02:38 +0000 |
| Subject: | Re: [SMARTY] To who's right is right?? | ||
| References: | 1 2 3 4 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-4909@lists.php.net to get a copy of this message | ||
You all made some good points. I was feeling guilty about having logic in the template, fearing that Im not
separating php from the template.
One thing that Ive realised with how Im doing it, is that when time comes to start using smarty's cache,
it would be difficult to implement in my setup.
The bottom line goal that I would like to achieve is a balance between php & template where
as you said, (the programmer doesn't have to bother designers and vice versa).
So Im going to go over my work and put logic in them, and hope for the best. It seems that would be
the route I should take.
I have to try and keep it as simple as possible.
Thanks
Monte Ohrt wrote:
I forgot the vice versa :) The programmer should _not_ have to touch template files to make changes to the application logic. The only exception is if the content being sent to the template changes, then maybe some template logic needs removed or skeletal structures added. Bertrand DUNOGIER wrote:-- Gerard Samuel http://www.trini0.org:81/ http://dev.trini0.org:81/MO> Rule of thumb: display/formatting logic goes in the template, all MO> other logic goes in your application. So in PHP do your db query MO> and assign the content to template, then format it there. If the MO> data is repetitive, loop through your data in the template to MO> display it in a table, etc. Absolutely. MO> The template editor should _not_ have to go into the PHP MO> application to make a change to the display of the content. I agree. On the application i worked on the two last month, there was a HUGE backend code, with massive database manipulation and all the stuff. Our webdesigner, who have only correct knowledge of control structures and loops, was able to achieve all his work by looking at the Debugging console and calling me 2 or 3 times. In my opinion, this is what you should end up with. Bertrand