CodeIgniter Forums
HAML in CodeIgniter - Printable Version

+- CodeIgniter Forums (
+-- Forum: Archived Discussions (
+--- Forum: Archived Development & Programming (
+--- Thread: HAML in CodeIgniter (/showthread.php?tid=13614)

HAML in CodeIgniter - El Forum - 11-29-2008

I was wondering if anyone has had any experience in integrating HAML templates in CodeIgniter - as you may be able to tell, I'm coming from the RoR world.

I know that there is a haml parser in php available publicly, but do not know how well it works, and if it can be integrated into CodeIgniter at all.

Does anyone have any experience with this?

HAML in CodeIgniter - El Forum - 11-30-2008

I checked it out but it's too bad the author didn't add SVN access so i could see the files without downloading the package.

But it probably is a class and you can use those very easy by adding them to the libraries directory. If the class needs constants to be see you create a wrapper here you set the constants and include the class.

HAML in CodeIgniter - El Forum - 11-30-2008

Thank you for the pointer, xwero. HAML is awesome, and I hope I might be able to use it with CodeIgniter.

I see from the download page, that the latest release is from over a year ago - and there have been *a lot* of improvements made in HAML since then, including the release of version 2.0. I hope the developer will continue to update his release, too!

HAML in CodeIgniter - El Forum - 12-03-2008

I wrote a haml parser from scratch for Kohana. If you look at my github repo you can probably integrate that file into your code. It takes an array (I use php's file($template) for instance) and transforms the haml to html.

There are some rules and shortcuts which I blogged about here: Hope that helps. Smile

HAML in CodeIgniter - El Forum - 12-03-2008

@transphorm: cool!!! Smile Thank you! I'll definitely have a look at that! Smile