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

File

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

Namespace

Assetic\Filter
View source
class PhpCssEmbedFilter implements DependencyExtractorInterface {
  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) {
  }
  public function getChildren(AssetFactory $factory, $content, $loadPath = null) {

    // todo
    return array();
  }

}

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::getChildren public function Returns child assets. Overrides DependencyExtractorInterface::getChildren
PhpCssEmbedFilter::setPresets public function