Skip to content

Instantly share code, notes, and snippets.

@Dattaya
Created February 16, 2012 12:15
Show Gist options
  • Select an option

  • Save Dattaya/1844433 to your computer and use it in GitHub Desktop.

Select an option

Save Dattaya/1844433 to your computer and use it in GitHub Desktop.
Symfony2.0.10. How to integrate assetic lessphp filter.

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

  • Run bin/vendors install;
  • Create a new file autoload_non_standart.php in app folder.
  • Add this to the end of app/autoload.php' file: php require 'autoload_non_standart.php';
<?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);
@jaywilliams
Copy link

See https://gist.github.com/3082684 for Symfony 2.1

@fractefactos
Copy link

@jaywilliams Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment