There appears to be something called PHPTal (unfortunately I'm not familiar with it).
Me neither, but there is a
PHPTAL template engine for Drupal [drupal.org], but I've not used it and there are no actual base themes yet (AFAIK).
Caribguy, do you use Plone with TAL? If so, can you give me your best case for using such a thing? As I say, I've never used PHPTAL or and TAL flavor, but I have used Smarty, which is a similar concept and, honestly, I just don't get it.
To me these template languages just force developers learn yet another syntax for the purported purpose of separating content from logic. Yet look at the example from the PHPTAL site (from what I read, PHPTAL is much friendlier than Smarty):
<div class="item" tal:repeat="value values">
<div class="title">
<span tal:condition="value/hasDate" tal:replace="value/getDate"/>
<a tal:attributes="href value/getUrl" tal:content="value/getTitle"/>
</div>
<div id="content" tal:content="value/getContent"/>
</div>
Wait, aren't "repeat", "condition" and "replace" program logic? Certainly in the PHP manual they would be listed under "Control Structures".
Yes, you are limiting the amount of damage a designer can do to the developer's code because you can't write functions and do low-level tasks, but now you need to find both a designer and a developer who know Smarty or PHPTAL, or you have to train them. Since the developer already knows PHP, it always seems easier to me to teach the designer a small subset of PHP and say, "You can only use these functions/structures in your template".
I find Smarty really hard to read as the control structures tend to be very compact and mix in visually with HTML (are there editors that do syntax highlighting for Smarty, PHPTAL et al?).
Finally, I find them harder to debug.
And then, development issues aside, at least in the case of Smarty, you have to load this pretty huge templating engine. I don't know how big the PHPTAL engine is, but it is a PEAR package so it's probably considerable.
Anyway, I know smarter people than I who swear by these things. I've never worked in an environment where you have separate teams of coders, designers, writers and so forth. For individuals and small teams, I see these as just a nuisance, but even there, I've known of solo developers who still swear by them.
[edited by: ergophobe at 7:11 pm (utc) on Apr 27, 2010]