class PhpCssEmbedFilter

A filter that embed url directly into css

@author Pierre Tachoire <pierre.tachoire@gmail.com> @link https://github.com/krichprollsch/phpCssEmbed

Hierarchy

Expanded class hierarchy of PhpCssEmbedFilter

1 file declares its use of PhpCssEmbedFilter
PhpCssEmbedFilterTest.php in drupal/core/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/PhpCssEmbedFilterTest.php

File

drupal/core/vendor/kriswallsmith/assetic/src/Assetic/Filter/PhpCssEmbedFilter.php, line 23

Namespace

Assetic\Filter
View source
class PhpCssEmbedFilter implements FilterInterface {
  private $presets = array();
  public function setPresets(array $presets) {
    $this->presets = $presets;
  }
  public function filterLoad(AssetInterface $asset) {
    $root = $asset
      ->getSourceRoot();
    $path = $asset
      ->getSourcePath();
    $pce = new CssEmbed();
    if ($root && $path) {
      $pce
        ->setRootDir(dirname($root . '/' . $path));
    }
    $asset
      ->setContent($pce
      ->embedString($asset
      ->getContent()));
  }
  public function filterDump(AssetInterface $asset) {
  }

}

Members

Namesort descending Modifiers Type Description Overrides
PhpCssEmbedFilter::$presets private property
PhpCssEmbedFilter::filterDump public function Filters an asset just before it's dumped. Overrides FilterInterface::filterDump
PhpCssEmbedFilter::filterLoad public function Filters an asset after it has been loaded. Overrides FilterInterface::filterLoad
PhpCssEmbedFilter::setPresets public function