FF-Silex-Less service provider
Simple less php service provider for Silex that uses https://github.com/leafo/lessphp as parser., (*1)
Simply specify paths for your .less files and target .css and if your .less files are newer than final .css file, final .css will be regenerated, (*2)
Installation
Create a composer.json in your projects root-directory:, (*3)
{
"require": {
"darklow/ff-silex-less-provider": "*"
}
}
and run:, (*4)
curl -s http://getcomposer.org/installer | php
php composer.phar install
Register provider
You must specify two required parameters and one optional:
* less.sources - Single path or array of paths of source - less files. Keep in mind that if .less file @import other .less files, you have to specify only main .less file
* less.target - Path to target .css file
* less.target_mode - Optionally you can specify file mode mask, (*5)
``` php
<?php
use FF\ServiceProvider\LessServiceProvider;, (*6)
// Register FF Silex Less service provider
$this->register(new LessServiceProvider(), array(
'less.sources' => array(DIR.'/../../Resources/less/style.less'), // specify one or serveral .less files
'less.target' => DIR.'/../../web/css/style.css', // specify .css target file
'less.target_mode' => 0775, // Optional
));
```, (*7)
License
'FF-Silex-Less' is licensed under the MIT license., (*8)