Templating engine?

Thomas Rösner aka TRauMa remove.all.to.last.dot.trauma at digital-trauma.de
Thu Jul 1 14:00:02 CEST 2004


has wrote:
> (Mind, I've thrown away thousands of lines of working code - including
> complete templating engines - precisely because it imposed the sorts
> of stupid artificial divisions that made them frustratingly inflexible
> and inextensible, so haven't arrived at the DOM-like design by
> accident.:)

I had some questions and reservations regarding your aproach, but they
vanished while I looked at the code and docs of HTMLTemplate (btw, perhaps
you could link the manual from your hp).

Only one question left: if you use a dom-like aproach to templating, don't
you force a certain tree like structure on the template? As far as I
understood, there is nothing like getElementbyID() to access a node object
regardless of where it is located in the tree. Say, I got a node named
"Menu", which is a div containing some links and a logo (menu.logo), and I
have to access this logo, and later on the designer (likely me wearing my
designer hat and being ignorant about such issues) decides to move the logo
somewhere else... Wouldn't that be a case of presentation forcing changes
upon application logic? Or am I missing something?

Question 2 (while I'm at it): For those of us stuck with PHP-only hosting,
do you know any comparable Template Engine for PHP? Up to now I used smarty,
but I'd like to try the DOM-Aproach.

Regards
	Thomas




More information about the Python-list mailing list