Jarves\Configuration\Asset::setCompression PHP Метод

setCompression() публичный Метод

public setCompression ( boolean $compression )
$compression boolean
    public function setCompression($compression)
    {
        $this->compression = $this->bool($compression);
    }

Usage Example

Пример #1
0
 /**
  * @return Asset[]
  */
 public function getAssets()
 {
     if (null === $this->assets) {
         preg_match('/(\\@[a-zA-Z0-9\\-_\\.\\\\]+)/', $this->getSrc(), $match);
         $bundleName = $match ? $match[1] : '';
         $prefixPath = $bundleName ? $this->getJarves()->resolvePath("{$bundleName}/Resources/public/") : '';
         $offset = strlen($prefixPath);
         $path = $this->getJarves()->resolveInternalPublicPath($this->getSrc());
         if (!$path) {
             return [];
         }
         $files = Finder::create()->name(basename($path))->files()->depth(!$this->getRecursive() ? '== 0' : null)->in(dirname($path))->sortByName();
         foreach ($files as $file) {
             $asset = new Asset(null, $this->getJarves());
             $file = ($bundleName ? $bundleName : '') . substr($file->getPathName(), $offset);
             $asset->setSrc($file);
             $asset->setType($this->getType());
             $asset->setPriority($this->getPriority());
             $asset->setCompression($this->getCompression());
             $this->assets[] = $asset;
         }
     }
     return $this->assets;
 }