Esempio n. 1
0
 /**
  * Filters an asset just before it's dumped.
  *
  * @param AssetInterface $asset
  */
 public function filterDump(AssetInterface $asset)
 {
     $this->dispatch(new LoadThemeVariables($variables = new Collection()));
     $compiler = new Compiler();
     if ($dir = $asset->getSourceDirectory()) {
         $compiler->addImportPath($dir);
     }
     $compiler->setVariables($variables->all());
     $asset->setContent($this->parser->parse($compiler->compile($asset->getContent())));
 }
Esempio n. 2
0
 /**
  * Filters an asset just before it's dumped.
  *
  * @param AssetInterface $asset
  */
 public function filterDump(AssetInterface $asset)
 {
     $compiler = new \lessc();
     $this->dispatch(new LoadThemeVariables($variables = new Collection()));
     $compiler->setVariables($variables->all());
     if ($dir = $asset->getSourceDirectory()) {
         $compiler->importDir = $dir;
     }
     foreach ($this->loadPaths as $loadPath) {
         $compiler->addImportDir($loadPath);
     }
     $asset->setContent($compiler->parse($this->parser->parse($asset->getContent())));
 }
 /**
  * Filters an asset after it has been loaded.
  *
  * @param AssetInterface $asset
  */
 public function filterLoad(AssetInterface $asset)
 {
     $asset->setContent($this->parser->parse($asset->getContent()));
     parent::filterLoad($asset);
 }
 /**
  * Filters an asset just before it's dumped.
  *
  * @param AssetInterface $asset
  */
 public function filterDump(AssetInterface $asset)
 {
     $asset->setContent($this->parser->parse($asset->getContent()));
 }
 /**
  * Filters an asset just before it's dumped.
  *
  * @param AssetInterface $asset
  */
 public function filterDump(AssetInterface $asset)
 {
     $asset->setContent(trim(Compiler::compile($this->parser->parse($asset->getContent()), ['filename' => $asset->getSourcePath()])));
 }