Jump to content

Templates


MrAdam

Recommended Posts

Hello everyone,I'd just like to get people's opinions on templating. Do you use a third-party template engine, a custom one or standard PHP files? I ask as I've started on a project with a designer / project developer kind of character; though he does have some limited knowledge of PHP. I'm wondering which approach would be the best. Whilst I can see the benefits of both approaches; template engines for their simplified syntax, added functionality such as macros, etc. And PHP for their simpleness, ease in a different respect, and of course native syntax. Which do you think is the best for this situation?Also if you were to go with standard PHP files for the templates, in what way would you implement them? How within a complex code base would you assign the unique page titles, meta descriptions/keywords, varied JavaScript and CSS files, etc.Thanks for any help you can give,Adam

Link to comment
Share on other sites

I think template engines are good for the following reasons:They help you separate presentation logic from processing logic - better support for an MVC architectureArranged in a hierarchical architecture, they allow a consistent display and code reuseThey can be used to support multi-lingual and localized pagesMany include caching, which speeds deliveryIt also makes it easier to have a designer handle the templates, while another person develops the business logic - since they are in different files.I like Smarty (http://smarty.net), there are many others.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...