Re: template engine...why???
| From: | rush | Date: | Wed, 30 Apr 2003 10:08:20 +0000 |
| Subject: | Re: template engine...why??? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-145745@lists.php.net to get a copy of this message | ||
"Ryan A" <ryan@jumac.com> wrote in message
news:040c01c30eb6$63c7a190$1301400a@l2zcaxu7emppqh...
> Why use a template engine?
>
> isnt it much easier to include a header and footer file with "include"?
>
> eg:
> <?php include "headerblah.php" ?>
>
>thats soooo much easier that learning some templating "language"...isnt it?
> I visited the smarty template site.....
If you need to create a site with 5-6 pages, you are doing it on your own,
and do not intend to do anything larger, that include is definitely easier
and simpler, because of the learning curve. It is not that everyone likes or
should use templates, but it is usually worth the effort, and even if you do
not use it in the end you may pick some ideas or style.
Also templates main focus is not only to achieve consistency (so that your
menu appears on all pages), but they also serve to get rid of mixed html and
code. And that's what incude-way does not solve very efficiently if at all.
Some template systems, like TemplateTamer will also point you in direction
of using more OO approach, but if that is overkill, it depends on the size
of the problem you are attempting to solve.
rush
--
http://www.templatetamer.com/