Hampton Lintorn Catlin

pHAML - Smarty Haml

Even though its capitalized correctly as “Haml”, here is another attempt at a PHP templating language inspired-by-Haml.

Looks pretty interesting, actually. Though, I haven’t done PHP in a long time and haven’t gotten a chance to look at it closely. Apparently it uses the Smarty system to do most of the rendering dirty work, which is pretty smart. We were considering early on compiling into ERB, but in the end shied away from it. Anyhow, pHAML has some interesting stuff like a debug-mode that is started by the ? character on a line. I’d love to read a tutorial on how it works, but right now, I don’t have the time to dive back into PHP. ;)

You can learn about pHAML here: http://i.cloudi.us/phaml/documentation

And, don’t forget the original phpHaml (for cakePHP and Symphony): http://phphaml.sourceforge.net/


Comments

Oct 20, 2007
Jeffrey Hardy said...
Hrm.. I like the <<< heredoc feature.
Jan 25, 2008
davmor said...
First, you did great with HAML, I was so jealous of the time it would save, that I had to write something similar in PHP. The funny thing is that I did not find phphaml, otherwise I would not have spent the time (yeah, I go with Larry Wall on laziness being an asset to programmers). pHAML is growing up, and has more interesting PHP stuff, I will document it all in over the next few weeks. I am getting it ready to propose it for inclusion as part of the PHP Framework. pHAML does not use Smarty (it is really just a huge regex and a couple of loops), it is stand-alone, and if one wanted, you could use it as an entire template system. It can be embedded in Smarty, to make Smarty more HAML like, or in the Zend Framework. I have been surprised at the passion which people seem to adopt it, HAML is strong stuff. I use it in production in a number of sites and it is just plain fast to program with. The other users have been sending in suggestions, so there is another iteration coming soon. The only issue that I seem to have now is that we are getting really busy, which is a good problem.