[thelist] info on templates, XML and TLAs

Tobyn Baugher toby at rsux.com
Fri Feb 28 15:29:01 CST 2003


On Friday, February 28, 2003 11:50 AM -0500 Rob Whitener
<rwhitener at DesignOptions.com> wrote:

> I have been following this thread from afar and it has piqued my
> interest. The hosting company my organization is currently using
> doesn't seem to have any kind of templating functionality installed
> with PHP (their insatallation of PERL doesn't even support the CGI
> module) so I have been having to kind of roll my own templating.

Your hosting company doesn't need to install a template library with
PHP. If you use Smarty (which is, IMHO, by far the best one) you just
put the Smarty directory somewhere you can find it and then
include/require the Smarty.class.php file.

Smarty is so fast and mature I would recommend using it over a
homegrown templating system every time. The only real reason to write
your own is if you're curious and want to learn how to make one.

You can use XML+XSLT to get the same kind of functionality provided you
and everyone else who's working on the site know XSLT. If you want to
see near the same levels of performance, though, you're going to need
to write some sort of caching system to save the transformed documents.
Smarty compiles templates into PHP script so that every run after the
first is as fast as including a PHP file, kind of like how JSPs are
compiled to Servlets. Transforming XML for every request without
caching somewhere is going to be a *lot* slower.

Unless I had some secondary reason for wanting to use it (ie. already
have a lot of my data in XML, boss says I have to, lots of in-house
XSLT expertise), OR my site was mostly static information that didn't
change a whole lot (for easy caching) I probably wouldn't be using
XML+XSLT. That's just my US$0.02

Oh, and if your hosting company doesn't have CGI.pm they need to get
their act together ;).

Regards,

Toby

--
Tobyn Baugher <toby at rsux.com>
http://www.rsux.com
aim: dieplzkthxbye  icq: 14281524  efnet: toby



More information about the thelist mailing list