Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Minification.php
Go to the documentation of this file.
1 <?php
7 
8 use Magento\Framework\View\Asset\Minification as AssetMinification;
11 
16 {
20  protected $fallback;
21 
25  protected $extensions;
26 
30  private $minification;
31 
36  public function __construct(ResolverInterface $fallback, AssetMinification $minification)
37  {
38  $this->fallback = $fallback;
39  $this->minification = $minification;
40  }
41 
53  public function resolve($type, $file, $area = null, ThemeInterface $theme = null, $locale = null, $module = null)
54  {
55  $file = $this->minification->addMinifiedSign($file);
56  $path = $this->fallback->resolve($type, $file, $area, $theme, $locale, $module);
57  if (!$path && $file != ($newFile = $this->minification->removeMinifiedSign($file))) {
58  $path = $this->fallback->resolve($type, $newFile, $area, $theme, $locale, $module);
59  }
60  return $path;
61  }
62 }
__construct(ResolverInterface $fallback, AssetMinification $minification)
resolve($type, $file, $area=null, ThemeInterface $theme=null, $locale=null, $module=null)
$type
Definition: item.phtml:13
$theme