/** * @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; }
public function __construct(Compiler $compiler, $relativeTempPath) { parent::__construct($compiler, ''); $this->relativeTempPath = $relativeTempPath; }
/** * @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; }
/** * @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; }