23 private $currentTheme;
47 \
Magento\Framework\View\DesignInterface $design,
48 \
Magento\Framework\View\Asset\GroupedCollection $assets,
50 \Psr\Log\LoggerInterface
$logger 52 $this->currentTheme = $design->getDesignTheme();
53 $this->pageAssets = $assets;
68 foreach ($this->currentTheme->getCustomization()->getFiles() as $themeFile) {
70 $service = $themeFile->getCustomizationService();
72 $identifier = $themeFile->getData(
'file_path');
73 $dirPath = \Magento\Framework\View\Design\Theme\Customization\Path::DIR_NAME
74 .
'/' . $this->currentTheme->getId();
75 $asset = $this->assetRepo->createArbitrary(
79 \
Magento\Framework\UrlInterface::URL_TYPE_MEDIA
81 $this->pageAssets->add($identifier, $asset);
83 }
catch (\InvalidArgumentException $e) {
84 $this->logger->critical($e);
__construct(\Magento\Framework\View\DesignInterface $design, \Magento\Framework\View\Asset\GroupedCollection $assets, \Magento\Framework\View\Asset\Repository $assetRepo, \Psr\Log\LoggerInterface $logger)
execute(Observer $observer)