Welcome Guest, Not a member yet? Register   Sign In
HAML in CodeIgniter

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?

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.

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!

I wrote a haml parser from scratch for Kohana. If you look at my github repo http://github.com/justinhernandez/kohaml...amlLib.php 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: http://blog.transphorm.com/kohaml-haml-m...for-kohana. Hope that helps. Smile

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

Theme © iAndrew 2016 - Forum software by © MyBB