Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ModuleNotation.php
Go to the documentation of this file.
1 <?php
8 
11 
21 class ModuleNotation implements Asset\PreProcessorInterface
22 {
26  private $cssResolver;
27 
31  private $notationResolver;
32 
37  public function __construct(
38  CssResolver $cssResolver,
39  \Magento\Framework\View\Asset\NotationResolver\Module $notationResolver
40  ) {
41  $this->cssResolver = $cssResolver;
42  $this->notationResolver = $notationResolver;
43  }
44 
48  public function process(Chain $chain)
49  {
50  $asset = $chain->getAsset();
51  $callback = function ($path) use ($asset) {
52  return $this->notationResolver->convertModuleNotationToPath($asset, $path);
53  };
54  $chain->setContent($this->cssResolver->replaceRelativeUrls($chain->getContent(), $callback));
55  }
56 }
__construct(CssResolver $cssResolver, \Magento\Framework\View\Asset\NotationResolver\Module $notationResolver)