25 $themeId = $this->
getRequest()->getParam(
'theme_id');
28 $themeFactory = $this->_objectManager->create(\
Magento\Framework\View\Design\
Theme\FlyweightFactory::class);
29 $theme = $themeFactory->create($themeId);
31 throw new \InvalidArgumentException(sprintf(
'We cannot find a theme with id "%1".', $themeId));
34 $customCssFiles =
$theme->getCustomization()->getFilesByType(
38 $customCssFile = reset($customCssFiles);
39 if ($customCssFile && $customCssFile->getContent()) {
40 return $this->_fileFactory->create(
41 $customCssFile->getFileName(),
42 [
'type' =>
'filename',
'value' => $customCssFile->getFullPath()],
46 }
catch (\Exception $e) {
47 $this->messageManager->addException($e,
__(
'We can\'t find file.'));
49 $this->_objectManager->get(\Psr\Log\LoggerInterface::class)->critical($e);
_redirect($path, $arguments=[])