Installing Haml-and-sass From Scratch

Hi all! I’m having some issues finding php-and-haml specific resources that start at square one. I was hoping to start a forum post that could help someone get all the way through the process of switching to haml in one post, and catalog anything that I had trouble with or seemed not-obvious to me. That way, anyone else who has these issues could find answers all in one place. With that in mind, can anyone help me with this starting point:

How do I get a webapp to use main.haml instead of main.php as a default layout?

Thanks!

Try an absolute path when setting layout:

$this->layout = ‘//layouts/main.haml’;

No luck. All that did was make the deal output the pre-parsed haml as the finished product. I made the /protected/components/Controller extend the AppController class included with the plugin, and I put this in the component config in main.php:





...


	// application components

	'components'=>array(


		'viewRenderer'=>array(

			'class'=>'application.extensions.phamlp.Haml',

//			// delete options below in production

			'ugly' => false,

			'style' => 'nested',

			'debug' => true,

			'cache' => false,

		),


...



Is there a step that I am missing?

Another interesting thing I noticed is that even though the Haml class is being instantiated, none of its methods are being called. Any ideas?

After messing with this for a bit, I managed to get haml to render most of the page, although it still is not rendering main.haml, nor is it completely parsing the haml inside the demo haml templates. This is what I get:

Any ideas?

Solution: example files have many things that are supposed to run encapsulated by

#(…)

These things should look like this:

#{…}

So curly brackets instead of parantheses. Once you change those, things start rendering correctly.

I’ve written a blog post on this, check out here :)

http://tipstank.com/2010/12/05/go-haml-with-yii-using-phamlp/

So I guess the templates included with the new extension now have the correct syntax? This was the biggest hang up for me getting started.

Not until you patch it first with my patch on R121 trunk :)I am just as new to haml as you, just started a week ago, so I patch up the templates to make people’s life easier :)