| Alexey Borzov 2005-03-26, 8:57 am |
| Hi,
Lukas Smith wrote:
> this has severe di vantage however since it does incurr a performance
> overhead that can be countered by caching. another di vantage 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/packa...ntro-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.
|