Jump to content

Best Template Engine?


tom.welch

Recommended Posts

Good afternoon guys and galls!

 

Firstly, sorry I'm sure this questions gets asked a lot. I have used the search and google, but there are so many template classes out there I though I would see what people here use and like.

 

I'm in the process of writing a site and I'm using something called DTemplate, its not been updated in a while and I'm sure its not the best thing out there hence my question here.

 

I'm looking for a really simple template engine. I have taken a look at PHP Smarty, but its quite complex and does much more than I need it to. Also I'm not too keen on how it uses the compile directory...

 

I need an engine that does loops and allows me to "hide" blocks of HTML code. I don't want to be putting IF statements into my template files though. The templates need to stay really simple.

 

Any suggestions?

Link to comment
Share on other sites

Any suggestions?

 

Id'e suggest avaioding a template engine all together. it really just adds another layer of complexity and most of the time you need to learn a new syntax just to write templates. Why not use pure php? It'll be quicker, and easier in the long run.

Link to comment
Share on other sites

As much as I hated template engines for the first few years I used PHP, I've recently started using Smarty and I finally understand why template engines exist. The syntax is really not that difficult, I learned how to use it effectively in a few hours. The separation of code and presentation is important to some people or in some cases, and for them, I'd suggest Smarty.

Link to comment
Share on other sites

The separation of code and presentation is important to some people or in some cases, and for them, I'd suggest Smarty.

 

Agreed, but you can get the same sort of seperation using mvc in pure php. It (template engines) just adds an extra layer that I really don't see a need for.

Link to comment
Share on other sites

Personally, I really like them. I really like keeping the PHP separate. As I say I've only been using a simple one, but it works well. I'm perfectly capable of coding HTML but its much quicker in dreamweaver :) Then I can just throw it into my template folder and all done.

 

The project I'm working on at the moment requires 2 templates also, and someone who is doing the HTML work is not to familiar with PHP, so saves me teaching them :)

Link to comment
Share on other sites

As much as I hated template engines for the first few years I used PHP, I've recently started using Smarty and I finally understand why template engines exist. The syntax is really not that difficult, I learned how to use it effectively in a few hours. The separation of code and presentation is important to some people or in some cases, and for them, I'd suggest Smarty.

 

If you really want to use a template engine, then I recommend you use Smarty too and don't bother looking at any other. It's well supported.

Thanks guys. Maybe I'll just sit down and have a good read.

 

Anyone have any other thoughts???

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.