views:

64

answers:

1

I'm trying to compare between the different template engines for PHP. The 2 that come up are smarty and PHPtemplate. How do I decide which is better for me.. These are some of the questions I'm trying to find answers to

  • What are some of the strengths and weaknesses of these 2
  • Is one better than the other in some cases or for some types of projects
  • Which is easier to learn and work with (flexible)
  • Are there any good additional template engines for PHP I'm missing
+3  A: 

Dunno what do you mean under PHPtemplate but assuming Drupal's native PHP template system.

  • Is one better than the other in some cases or for some types of projects

in case you gonna let users edit templates, both are bad. Go for something XTemplate-like.
Otherwise both PHP and PHP written in PHP (Smarty) are all right

  • Which is easier to learn and work with (flexible)

PHP for sure

  • Are there any good additional template engines for PHP I'm missing

A whole lot.

Col. Shrapnel
Thanks Col. When you say "users", you mean the average joe or developers? I'd like developers to add their own templates or override existing templates cleanly. So you're saying Smarty makes this difficult? It's very popular though.
dave
@dave what developers? One who can access PHP code, can access whole site backend. it's security issue. Smarty doesn't make it difficult, but i see no sense in learning another PHP when I can use old one. It's popularity is a big mistake. Though you can use it as a secure template engine AFAIK. There are some options to turn on.
Col. Shrapnel
I mean we are talking about an open source CMS that has a template engine. So the developer has access to all the code and wants to build his own template.
dave
@dave Smarty isn't about providing user-customizable templates, it's targeted at developers who want a template engine and have decided (for reasons I can't fathom) not to use PHP's built-in templating capabilities.
meagar