public
Last active

Symfony2.0.10. How to integrate assetic lessphp filter.

  • Download Gist
1. README.md
Markdown

Symfony2.0.10. How to integrate assetic lessphp filter.

  • Add the following lines of code to the end of the deps file:
[lessphp]
    git=https://github.com/leafo/lessphp.git
    target=/lessphp
    version=v0.3.2

List of available versions: https://github.com/leafo/lessphp/tags

#...
assetic:
    #...
    filters:
        lessphp:
            file: %kernel.root_dir%/../vendor/lessphp/lessc.inc.php
            apply_to: "\.less$"
20. autoload_non_standart.php
PHP
1 2 3 4 5 6 7 8 9 10 11 12 13
<?php
spl_autoload_register(function($className)
{
$ds = DIRECTORY_SEPARATOR;
 
$vendor = __DIR__."{$ds}..{$ds}vendor{$ds}";
$loadable = array(
'lessc' => "lessphp{$ds}lessc.inc.php",
);
 
isset($loadable[$className]) ? require $vendor.$loadable[$className] : '';
 
}, false);

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.