tom.welch Posted October 28, 2007 Share Posted October 28, 2007 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? Quote Link to comment Share on other sites More sharing options...
trq Posted October 28, 2007 Share Posted October 28, 2007 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. Quote Link to comment Share on other sites More sharing options...
Jessica Posted October 28, 2007 Share Posted October 28, 2007 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. Quote Link to comment Share on other sites More sharing options...
trq Posted October 28, 2007 Share Posted October 28, 2007 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. Quote Link to comment Share on other sites More sharing options...
toplay Posted October 28, 2007 Share Posted October 28, 2007 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. Quote Link to comment Share on other sites More sharing options...
tom.welch Posted October 28, 2007 Author Share Posted October 28, 2007 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 Quote Link to comment Share on other sites More sharing options...
tom.welch Posted October 28, 2007 Author Share Posted October 28, 2007 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??? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.