Re: Template?
| From: | Richard Lynch | Date: | Tue, 12 Dec 2000 04:40:54 +0000 |
| Subject: | Re: Template? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-29814@lists.php.net to get a copy of this message | ||
I don't think Templates have anything to do with caching the results of an
SQL query.
Templates are basically just files that look like this:
<HTML>
<BODY>
<MORE TAGS>{foo}</MORE>
</BODY>
</HTML>
And the Template engine replaces {foo} with <?php print $foo;?>
AFAIK, none of the Template classes cache the database results -- nor should
they.
If your database is static enough to be cached, you can use PHP from the
command line to generate static HTML, and put the static HTML on your site
instead of having a dynamic site. For a very large site with tons of
content in the database, this can improve performance. For a small to
medium site, you're probably wasting a lot of time for minimal benefit.
[rant]
Apparently, Designers are not to be trusted with editing files that include
PHP source, and the ideal of separating "Logic" from "Content" for a more
modular design make templates a Good Idea (tm).
I personally don't think you really can separate logic/content to that
degree -- Virtually anything non-trivial to be changed in either requires a
change in the other anyway.
And if your Designer can't deal with leaving the PHP parts alone, you've got
a problem Designer anyway, almost for sure.
[/rant]
----- Original Message -----
From: Wee Chua <Chua@mail.interclean.com>
Newsgroups: php.general
Sent: Monday, December 11, 2000 11:43 AM
Subject: [PHP] Template?
> Hi all,
> Could anyone give me the concepts or ideas of how is template worked? I
> would like to store my result after running sql query, should I store the
> result into a file or inside the template? How is that worked? I really
> appreciate if anyone could explain to me, it would be better if anyone can
> show some examples. Thank you very much.
>
> Calvin Chua
> Systems Analyst
> InterClean Equipment, Inc.
> 734-975-2967
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>