I just read Harry Fuecks' slides from the last PHPUG meeting (via Bitflux). It is indeed a nice summary on many different concepts in template technologies for PHP.
There are a few thoughts, I'd like to add though. Maybe they were already discussed at the meeting; unfortunately I wasn't able to go there.
One thing was, that XSLT seemed to be out of the scope of the talk, although it is often promoted as a solution for separating design and code. Greg once told me about an interesting idea: Applications could output XSLT that transform a XHTML template (instead of the common way, where your application outputs XML which is transformed by a XSL Template into (X)HTML). This allows the usage of Dreamweaver and other tools, but requires the adherence of some rules about the naming of CSS classes, pseudo attributes and/or filler texts.
The other thoughts stem from our experience. In our projects the ratio of the number of design elements to repetitiveness and conditional logic tends so much to the code side, that templates would be an unnecessary complication and having direct HTML generation in code (probably organized in similar ways as one would output XML from code) is the clearly more feasible solution for us. And if not that alone, internationalization (or in the case of Switzerland rather 'nationalization') would definitely slant the ratio to unbearable. We use a simple label based translation table, which works wonderfully for translators. But I don't want to imagine how templates that use that much conditional structures and then only translation labels would look like.
Equipped with these lessons, the latest development in CSS based designs (and web designers learning these techniques) makes me wonder, wether moving the abstraction layer of design and code separation to the browser wouldn't be a very feasible solution in much more cases. Using similar patterns already used to output XML through a controller part (in MCV), one could output XHTML with a rich variety in CSS classes and the design would be determined solely through CSS. No traditional template systems at all. We will definitely move in this direction, in fact newer projects are realized in this way only. IMHO, this also goes towards what Jon Udell is talking about, i.e. the increased reusability of content.
Posted by seefeld at October 10, 2003 11:22great writeup bernhard.
some thoughts:
the xml:lang attribute remains underutilized within xhtml
content negotiation (accept-language headers etc) could make a lot of it transparent
standardized ways to get another language representation of a resource (is this a W3C TAG issue?) would help