Skip to content

Instantly share code, notes, and snippets.

@keithics
Created July 12, 2013 04:38
Show Gist options
  • Save keithics/5981506 to your computer and use it in GitHub Desktop.
Save keithics/5981506 to your computer and use it in GitHub Desktop.
https://github.com/kriswallsmith/assetic using Assetic with Laravel 4
use Assetic\AssetManager;
use Assetic\Asset\AssetCollection;
use Assetic\Asset\FileAsset;
use Assetic\Asset\GlobAsset;
use Assetic\Filter\Yui;
use Assetic\AssetWriter;
$am = new AssetManager();
$yui = new Yui\JsCompressorFilter('/var/www/laravel/yuicompressor.jar');
// $yui->setNomunge(true);
$js = new GlobAsset('/var/www/laravel/public/admin_assets/js/*.js');
$ac = new AssetCollection(array($js), array($yui));
$ac->setTargetPath('min.js');
$am->set('basejs',$ac);
$writer = new AssetWriter('/var/www/laravel/public/admin_assets/min');
$writer->writeManagerAssets($am);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment