[bitflux-cms] PHPTal vs. PatTemplate vs. XSLT
Christian Stocker
chregu at bitflux.ch
Thu Dec 23 08:35:05 CET 2004
Hi
On 22.12.2004 19:35 Uhr, Ramin wrote:
> Just spent some time on the PAT website. They have some nice
> libraries. I was just wondering, besides PatForms, if any other of
> their libraries have been put into BxCMS or plan to be put in.
If we need a library for something and the pat-project do provide them,
then why not. Currently I don't see a library, which we desperatly would
need. But it's our general approach to reuse existing libraries,
wherever we can (and makes sense) instead of reinventing the wheel
> One of the libraries that really caught my attention was PatTemplate.
> I was just wondering why BxCMS chose to use phpTal as opposed to
> something like PatTemplate (or even the PEAR template packages). What
> are the advantages / disadvantages, etc. I'm just curious cause I
> don't really know enough about either one to make a judgement myself.
> Most likely I'm just going to use XSLT, unless PhpTal or PatTemplate
> have a lot more to offer than XSLT does.
Disclaimer: I didn't use any of the traditional PHP template engines
like patTemplate, smarty, IT, etc since years.. So I may be biased.
First of all, we don't use phptal, we use something called (xsl)tal
(working title). The only similarity to phptal is, that it's the same
syntax, but both share that also with the original tal implementation in
Zope ;) So. Zope's TAL (or ZPT), PHPTAL and (XSL)TAL all use the same
syntax, but not the same code...
Then again, we at Bitflux do not really use (xsl)tal, either. Our main
templating language is XSLT. We're more used to that and it's far more
powerfull than (xsl)tal. We plan to provide a full working demo based on
(xsl)tal in the future, as it's easier for "newbies" to get used to it.
Why not patTemplate? I personally just don't like all those traditional
templating system. It doesn't seperate (IMHO) enough. Furthermore and
more important, with popoon, it's always XML-in/XML-out. Therefore for
the templating, I just get an XML with the content and I will transform
that to some other XML (normally just XHTML). If I'm a template
designer, I don't have to know anything about PHP, just xsltal or xslt
(or whatever else you choose there), but can still do a lot with it and
apply "design logic" to it (which is certainly also possible with
pattemplate, but imho you have soon to go into php, if you want to do
more complex "design logic"). Furthermore I can pipeline through more
than one transformer. Meaning I could use 2 or more xslt templates in a
row (we use that for filters for examples).
And last but not least, XSLT has quite a different approach to
templating than the rest and I really prefer that to the others.
phptal and pattemplate don't have to offer more than xslt, they have a
different approach. Some stuff is difficult to do in xslt and you really
have to get used to it, since a whole other concept. But with the
addition of the (evil) possibility to call PHP functions from within
xslt, it's easier to implement some stuff in xslt, which wasn't possible
before.
HTH
chregu
--
christian stocker | Bitflux GmbH | schoeneggstrasse 5 | ch-8004 zurich
phone +41 1 240 56 70 | mobile +41 76 561 88 60 | fax +41 1 240 56 71
http://www.bitflux.ch | chregu at bitflux.ch | gnupg-keyid 0x5CE1DECB
More information about the bitflux-cms
mailing list