public setCssCompressor ( string $compressor ) | ||
$compressor | string | Identifier of the compressor |
function setCssCompressor($compressor)
{
if (!isset($this->compressors[$compressor])) {
throw new \InvalidArgumentException(sprintf('Undefined compressor "%s"', $compressor));
}
$css = $this->contentType('.css');
if ($this->cssCompressor !== null) {
$this->bundleProcessors->unregister($css, $this->compressors[$this->cssCompressor]);
}
$this->cssCompressor = $compressor;
$this->bundleProcessors->register($css, $this->compressors[$compressor]);
}
function createEnvironment() { $env = new Environment(); $loadPaths = $this->loadPaths ?: array(); foreach ($loadPaths as $path) { $env->appendPath(dirname($this->filename) . "/" . $path); } if (!$this->debug) { if ($jsCompressor = $this->jsCompressor) { $env->setJsCompressor($jsCompressor); } if ($cssCompressor = $this->cssCompressor) { $env->setCssCompressor($cssCompressor); } } return $env; }