Re: Re: template, not template that is the problem.
| From: | Alexey Borzov | Date: | Sat, 26 Mar 2005 10:49:28 +0000 |
| Subject: | Re: Re: template, not template that is the problem. | ||
| References: | 1 2 3 4 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-18356@lists.php.net to get a copy of this message | ||
Hi,
Lukas Smith wrote:
this has severe disadvantage however since it does incurr a performance overhead that can be countered by caching. another disadvantage is that it doesnt allow any loayout relevant logic. meaning you need to add another layer to truly separate business from layout. for example its not easily possible to give the designer the choice to use alternating row colors without using another layer or embedding the necessary logic in your business logic.In fact ITX and Sigma allow one to embed callback functions into the template (the callbacks in ITX are limited and not documented, though). The usage example from Sigma docs shows how that can be used for doing the alternating row colours trick you mentioned: http://pear.php.net/manual/en/package.html.html-template-sigma.intro-syntax.php Of course the programmer has to write functions to process these callbacks, but after that the designer can do everything himself. And all presentation logic like the fact that row colours are changing and the colours themselves are kept in the template. The same technique can be used to embed e.g. gettext() calls directly into the template.