Page 1 of 1
HTML templating like Haml?
Posted: Fri Mar 16, 2012 2:05 pm
by cootcraig
I'm brand new to PHP web development. I'm just getting started and
looking at frameworks for my first work project. Most of my web work
has been with Ruby using the Haml templating gem. What HTML
template libraries are common and recommended with PHP?
Haml online:
http://haml-lang.com/
Re: HTML templating like Haml?
Posted: Wed Apr 18, 2012 5:12 pm
by x_mutatis_mutandis_x
Since php get interpreted and not compiled, php itself can be used for templates. However there are template engines out there that will make your life easy (<? & ?> tags littered all over the code kinda gets annoying). Check out smarty
http://smarty.net
Re: HTML templating like Haml?
Posted: Wed Apr 18, 2012 5:23 pm
by pickle
There are tons of different templating engines. However, I think a sizeable group of developers will just tell you to use native PHP files, or an engine like
Savant that lets you use native syntax.
Systems like Smarty just compile yet another syntax into native PHP files, then runs those files. The conclusion a lot of developers have come to is: Why not just cut out the middle man?
With that said, if your templates are being built & maintained by a designer that you don't want to give them full code access, Smarty is the most popular.
Re: HTML templating like Haml?
Posted: Wed Apr 18, 2012 10:27 pm
by Christopher