HAML into PHAML?

December 3rd, 2006 at 4:07 pm by Joel in PHP, Ruby

I discovered HAML several months ago and instantly fell in love with it. I can just see how it would increase any developers productivity and speed up development time. Not to mention actually producing nice, clean and great looking XHTML markup.

This is your template:

!!!
%html{ :xmlns => "http://www.w3.org/1999/xhtml", :lang => "en", 'xml:lang' => "en" }
%head
%title BoBlog
%meta{ 'http-equiv' => 'Content-Type', :content => 'text/html; charset=utf-8' }/
= stylesheet_link_tag 'main'
%body
#header
%h1 BoBlog
%h2 Bob's Blog
#content
- @entries.each do |entry|
.entry
%h3.title= entry.title
%p.date= entry.posted.strftime("%A, %B %d, %Y")
%p.body= entry.body
#footer
%p
All content copyright
 

Leave your Comments

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>