예제 #1
0
 /**
  * @return CssLoader
  */
 protected function createComponentCssPrint()
 {
     /** @var \WebLoader\Compiler $compiler */
     $compiler = $this->context->getService('webloader.cssPrintCompiler');
     $loader = new CssLoader($compiler, $this->template->basePath . '/webtemp');
     $loader->setMedia('print');
     return $loader;
 }
예제 #2
0
파일: CssLoader.php 프로젝트: svobodni/web
 public function __construct(Compiler $compiler, $relativeTempPath)
 {
     parent::__construct($compiler, '');
     $this->relativeTempPath = $relativeTempPath;
 }
예제 #3
0
 /**
  * @param array $fileNames
  * @param string|FALSE $media
  * @param string $stylesDir
  */
 private function lessComponentWrapper(array $fileNames, $media = NULL, $stylesDir = NULL)
 {
     if ($media === NULL) {
         $media = 'screen,projection,tv';
     }
     if ($stylesDir === NULL) {
         $stylesDir = __DIR__ . '/../styles';
     }
     $outputDirName = '/tmp/css';
     $fileCollection = new WebLoader\FileCollection($stylesDir);
     $fileCollection->addFiles($fileNames);
     $name = strtolower(substr($this->name, strrpos($this->name, ':') + 1)) . '.css';
     if (file_exists($stylesDir . '/' . $name)) {
         $files->addFile($name);
     }
     $compiler = WebLoader\Compiler::createCssCompiler($fileCollection, $this->context->parameters['wwwDir'] . $outputDirName);
     $filter = new WebLoader\Filter\LessFilter();
     $compiler->addFileFilter($filter);
     $control = new WebLoader\Nette\CssLoader($compiler, $this->template->basePath . $outputDirName);
     if (is_string($media)) {
         $control->setMedia($media);
     }
     return $control;
 }
예제 #4
0
파일: CssLoader.php 프로젝트: venne/assets
 /**
  * @param \WebLoader\Compiler $compiler
  * @param string $relativeTempPath
  * @param \Nette\Http\Request $httpRequest
  */
 public function __construct(Compiler $compiler, $relativeTempPath, Request $httpRequest)
 {
     parent::__construct($compiler, '');
     $this->relativeTempPath = $relativeTempPath;
     $this->httpRequest = $httpRequest;
 }