Skip to content

Commit

Permalink
updated README to show less.php config example
Browse files Browse the repository at this point in the history
  • Loading branch information
mon committed May 19, 2010
1 parent 3c87364 commit cbe2fa4
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ To Use

Sample Code
------------




** /media/css/style.less **

@bodyBkgColor: #EEE;
Expand All @@ -25,15 +29,35 @@ Sample Code
h1 { font-size: 3em; }
}

** APPPATH/config/less.php **

return array(
'compress' => TRUE,

// relative PATH to a writable folder to store compiled / compressed css
// path below will be treated as: DOCROOT . 'media/css/'
'path' => 'media/css/',
);

** APPPATH/classes/controller/sample.php **

Controller_Home extends Controller_Template {

public $template = 'template';
public $stylesheets = array('/media/css/reset.less', '/media/css/style.less');

// no need to add .less extension
public $stylesheets = array('reset', 'style');

public function action_index()
{
$stylesheets = $this->stylesheets;

foreach (stylesheets as $key => $value)
{
// I keep my less files inside APPPATH . 'media/less/' but can be anywhere
$stylesheets[$key] = APPPATH . 'media/less/' . $value;
}

$this->template->stylesheets = Less::set($this->stylesheets);
}
}
Expand Down

0 comments on commit cbe2fa4

Please sign in to comment.