Extension For Using Less In Yii

Hey guys,

I created an extension for Yii to support LESS CSS.

While I found a few existing extensions I feel that they did not have the correct approach.

My extension is a behavior that should be attached to CClientScript.

After being attached it can be used to register LESS files just like you would CSS files:

Yii::app()->getClientScript()->registerLessFile($path-to-less-file, $media);

  • It includes lessphp (leafo.net) which is used to compile the LESS files to normal CSS.

  • CSS files are by default published to [assets]/less/randomfilename.css

At this point there is no support for clientside LESS using less.js, this will be added later.

Posting this in the forum since my forum account is too "new".

And since I can’t post links go to github and check the SamMousa/yii-less repository to find out more!