IMO, Smarty is just an abstraction of PHP. Smarty templates are HTML templates, but they still contain their own application logic for looping, etc, and so are still not a real separation (or are *dirty*, as 'rush' calls it).

XML+HTML+XSLT (or Template Tamer from what I can gather) take it the extra step. The application logic in PHP generates an XML data stream, which contains no dependencies on output. It is simply data. The XSLT parser parses the HTML template (which contains _only_ HTML and placeholders), and when it encounters a placeholder it executes the relevant XSLT code. This way, the design department can design the HTML fully, without having to learn PHP, Smarty, or any other syntax. They just put in placeholder tags wherever information from the XML file is needed.

There are drawbacks to every abstraction, and templating is no different. Smarty templates are fast, and are enjoyed by a large user base for their relative simplicity. XML, XSLT, etc are complex and verbose, but provide for maximum abstraction. Template Tamer sounds like it combines the best from both (from what I've heard here).

It is a matter of taste, I suppose. I think that people may sometimes waste more time trying to maximize the division between presentation and logic than it's worth. Well written PHP scripts can be almost as good a template as any (by separating the HTML and just using embedded variables).

HTH,
Pete.

--
<Pusher>
http://www.shaman.ca/pusher

A news aggregator with email notification.


-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to