25 $themeId = $this->
getRequest()->getParam(
'theme_id');
29 $urlDecoder = $this->_objectManager->get(\
Magento\Framework\Url\DecoderInterface::class);
30 $fileId = $urlDecoder->decode($file);
33 $theme = $this->_objectManager->create(
34 \
Magento\Framework\View\Design\ThemeInterface::class
37 throw new \InvalidArgumentException(sprintf(
'Theme not found: "%1".', $themeId));
39 $asset = $this->_assetRepo->createAsset($fileId, [
'themeModel' =>
$theme]);
40 $relPath = $this->_appFileSystem->getDirectoryRead(DirectoryList::ROOT)
41 ->getRelativePath($asset->getSourceFile());
42 return $this->_fileFactory->create(
50 }
catch (\Exception $e) {
51 $this->messageManager->addException($e,
__(
'File not found: "%1".', $fileId));
53 $this->_objectManager->get(\Psr\Log\LoggerInterface::class)->critical($e);
_redirect($path, $arguments=[])