RE: [phplib] Compiled templates vs. parsed From: Andreas Aderhold (a.aderhold <email protected>)
Date: 03/29/01

Hi Maxim,

[Why parsed templates]
> Because while the layout does not change, the data does change.
Right, but why waste time parsing the layout everytime. Smarty does a crufty
thing. It comiples the layout to mixed php, so you have fast executing
layouttemplates in combination with dynamic data.

> The approach would work if the data does not change. So why use any of the
> template engine if you could use plain HTML in this case? It's damn fast!
:)
Caus' i have database behind the frontend, and so I need the templates.

> AA> The time-overhead to check for changes is minimal compared
> AA> to parsing and accessing the database for each and every hit. For big
sites
> AA> this is very cool, since the load on the database is reduced to a
minimum.

> Wrong. You'll need to hit the db the same way to check if the changes
> has occurred.
Yes, but I do not have to do, say, 3 selects and 2 subselects. I only have
to do that if data has changed. Maybe there could be an extra table that
holds a flag if a table has changed.

> (some of the > data you publish may not be in a database, but is computed
from
> other sources) - you'll need to know if the data has changed.
Good point. Its not a good idea for rapidly altering data.

I heard that Enterprise systems do so (i know from the GAUSS CMS) they do
that way (compiling to HTML).

Well I think I'll continue using Smarty and maby output buffering as
provided with pear.

cu,
andi

---------------------------------------------------------------------
To unsubscribe, e-mail: phplib-unsubscribe <email protected>
For additional commands, e-mail: phplib-help <email protected>