Loads LESS files using the PHP implementation of less, lessphp.
Less files are mostly compatible, but there are slight differences.
@link http://leafo.net/lessphp/
@author David Buchmann <david@liip.ch> @author Kris Wallsmith <kris.wallsmith@gmail.com>
Expanded class hierarchy of LessphpFilter
class LessphpFilter implements FilterInterface {
private $presets = array();
public function setPresets(array $presets) {
$this->presets = $presets;
}
public function filterLoad(AssetInterface $asset) {
$root = $asset
->getSourceRoot();
$path = $asset
->getSourcePath();
$lc = new \lessc();
if ($root && $path) {
$lc->importDir = dirname($root . '/' . $path);
}
$asset
->setContent($lc
->parse($asset
->getContent(), $this->presets));
}
public function filterDump(AssetInterface $asset) {
}
}
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
LessphpFilter:: |
private | property | ||
LessphpFilter:: |
public | function |
Filters an asset just before it's dumped. Overrides FilterInterface:: |
|
LessphpFilter:: |
public | function |
Filters an asset after it has been loaded. Overrides FilterInterface:: |
|
LessphpFilter:: |
public | function |