[thesite] PHP Templating Engine

Mark Nickel mnickel at new.rr.com
Mon Oct 15 07:52:57 CDT 2001


With the subtle shift to using PHP for more stuff...  One should be
asking the question, do I want to be stuffing HTML code into my nice,
clean, and tidy PHP code.

The answer should be no.  :)   Separation of logic from presentation is,
IMHO, a good thing.

PHPLib is one engine, but I've been using Smarty more and more...

http://www.phpinsider.com/php/code/Smarty/

I forgot to mention this at the CodeFest to the folks working on the Tip
conversion from Perl to PHP.  ( as well as forgetting your names... :(
sorry )

I know that there are several templating engines to choose from, but
this one seems to be really useful.  It's even got some HTML builder
functions for SELECT HTML form elements, stuff like that...

Granted there is a bit more overhead with using an engine rather than
straight PHP code, but Smarty tries to compensate for this by generating
"compiled" templates.   So after the initial access, the engine referes
to a compiled version rather than running through the template process.
By compiled, I mean straight PHP code...

All and all it's pretty clever...  :)

Mark




--
"Caution: Cape does not enable user to fly."

-Batman costume warning label






More information about the thesite mailing list