Re: Smarty vs PEAR::HTML_Template_IT
| From: | Bertrand Mansion | Date: | Tue, 17 Dec 2002 11:09:42 +0000 |
| Subject: | Re: Smarty vs PEAR::HTML_Template_IT | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-3014@lists.php.net to get a copy of this message | ||
<jeroen@terena.nl> wrote :
> Hi all,
>
> What is the main difference bewteen Smarty and PEAR::HTML_Template_IT ?
> Has anyone switched from one to the other and if so, why?
Hi Jeroen,
HTML_Template_IT is much easier to use and for your designers to work with.
On the other hands, it lacks a lot of features found in Smarty such as
modifiers, control structures and caching. In Smarty, you can put a lot of
logic inside your templates, this will make your PHP scripts much shorter in
many cases but will make your templates more complex.
Personally, I prefer to have the logic inside my PHP scripts and use
templates only for display operations. That's why I use HTML_Template_IT 90%
of the time, along with Cache_Lite. HTML_Template_IT is also faster AFAIK
than Smarty but I didn't do any benchmarks. Look at
http://www.phpinsider.com/benchmarks/ for
benchmarks.
I suppose the choice is based on your philosophy. I like the
Model-View-Controller design pattern and I think HTML_Template_IT conforms
to it better. On the other hand, Smarty is a really well written and
powerful piece of software and will take you further if you need more power
and flexibility in your templates. Its learning curve is steeper though.
I also find HTML_Template_IT templates easier to maintain.
Bertrand Mansion
Mamasam