At PHP Forum, Rasmus said this about the “templating engine question coming back every year”:

PHP *is* a templating engine by itself. Adding another templating engine on top of it just doesn't make sense. The only situation where it makes sense, is when you don't trust the template to contain nice behaving code.

I so much agree…

Of course, in b2evo, you can’t always trust the template/skin… so we’ll need to implement some kind of templating… but we’re really gonna make it lightweight!


Comments from long ago:

Comment from: Thierry

“in b2evo, you can’t always trust the template/skin” I so much agree…

2005-11-16 23-28

Comment from: Roman

PHP is a templating engine, ofcourse, but other (PHP based) templating engines are abstraction layers between template itself and program code. Template creator will need to know only small subset of commands, and will be able to create affordable templates to use with some product. It allows to separate program development, and design/templates creation, and to increase modularity and scalability of product ;)

Also, templating engine is needed when you must solve some specific problems in a shortest possible time.

2005-11-19 02-21

Comment from: François Planque

What’s the problem with the template creator only using a “small subset of commands” of PHP? Are template creators genetically unable to type <?php and they have to type something else like %% instead?

For the rest, I won’t even argue. I didn’t say that templates are useless, I said that you don’t need yet another language for them. (Actually I did say that templates are oftentimes a bad idea, but that’s another story…)

2005-11-21 14-07

Comment from: Roman

“Templates are oftentimes a bad idea” - right words :) But sometimes they’re good idea IMHO. I don’t think, that all template are genetically deviated species. But difference between php and template engines isn’t in opening and closing tags, am I right? They are implementing different conceptions of coding. As a programmer, I think, that you are right, and use of PHP is more efficient, than use of any php-based TE. But, sometimes, template engine is more convenient way - for me, and for maintainer of my product (website). IMHO.

2005-11-21 14-45

Comment from: Roman

Correction: “I don’t think, that all template creators are genetically deviated species”.

2005-11-21 14-47

Comment from: François Planque

I don’t think you are right, precisely! The only real difference between PHP and template engines is syntax! (opening/closing tags and a few other details).

Once again, the only benefit of a templating engine (not talking about templates altogether here) is to filter out harmful PHP features if you don’t trust the template author, which should not be the case if you are the author.

2005-11-21 14-59

Comment from: Roman

Benefits: abstraction from main code modules; intensive code reuse; easy integration; customizable syntax; built in smart caching possibilities (some TE’s); TE can be implemented as PHP module (efficient?); design can be changed without changing main program code - I really don’t trust template author… sometimes…

2005-11-21 15-15

Comment from: François Planque

yeah yeah yeah … a zillion arguments for properly structuring your PHP and still only one for template engines: when you don’t trust the template…

(PS: I have nothing against using a cacheing mechanism – But that’s yer another off-topic suggestion – I just don’t think you need to wrap your cacheing into a templating engine.)

2005-11-21 18-23

Comment from: Roman

Khm… Yeah. You’re right. Ok 8)

2005-11-21 18-57