HTML templating like Haml?

Discussion for various published PHP frameworks, including Zend Framework, CodeIgniter, Kohana, CakePHP, Yii, Symfony, and others.

Moderator: General Moderators

Post Reply
cootcraig
Forum Newbie
Posts: 9
Joined: Thu Mar 15, 2012 4:23 pm

HTML templating like Haml?

Post 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/
x_mutatis_mutandis_x
Forum Contributor
Posts: 160
Joined: Tue Apr 17, 2012 12:57 pm

Re: HTML templating like Haml?

Post 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
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: HTML templating like Haml?

Post 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.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: HTML templating like Haml?

Post by Christopher »

(#10850)
Post Reply