59 \
Magento\Framework\View\Design\FileResolution\Fallback\
File $fallbackFile,
60 \
Magento\Framework\View\Design\FileResolution\Fallback\TemplateFile $fallbackTemplateFile,
61 \
Magento\Framework\View\Design\FileResolution\Fallback\LocaleFile $fallbackLocaleFile,
62 \
Magento\Framework\View\Design\FileResolution\Fallback\StaticFile $fallbackStaticFile,
63 \
Magento\Framework\View\Design\FileResolution\Fallback\EmailTemplateFile $fallbackEmailTemplateFile,
66 $this->_fileResolution = $fallbackFile;
67 $this->_templateFileResolution = $fallbackTemplateFile;
68 $this->_localeFileResolution = $fallbackLocaleFile;
69 $this->_staticFileResolution = $fallbackStaticFile;
70 $this->_emailTemplateFileResolution = $fallbackEmailTemplateFile;
71 $this->_assetRepo = $assetRepo;
83 list($module, $filePath) = \Magento\Framework\View\Asset\Repository::extractModule(
89 $this->_assetRepo->updateDesignParams(
$params);
90 $file = $this->_fileResolution
104 $this->_assetRepo->updateDesignParams(
$params);
105 return $this->_localeFileResolution
118 list($module, $filePath) = \Magento\Framework\View\Asset\Repository::extractModule(
124 $this->_assetRepo->updateDesignParams(
$params);
125 return $this->_templateFileResolution
138 list($module, $filePath) = \Magento\Framework\View\Asset\Repository::extractModule(
144 $this->_assetRepo->updateDesignParams(
$params);
145 return $this->_staticFileResolution
159 $this->_assetRepo->updateDesignParams(
$params);
160 return $this->_emailTemplateFileResolution
174 $parts = explode(
'/',
$path);
177 foreach ($parts as $part) {
178 if (
'..' === $part) {
184 }
elseif (
'.' !== $part) {
213 list($relatedPath,
$path) = self::ltrimSamePart($relatedPath,
$path);
214 $toDir = ltrim(dirname(
$path),
'/');
218 $offset = str_repeat(
'../', count(explode(
'/', $toDir)));
220 return rtrim($offset . dirname($relatedPath),
'/');
242 private static function ltrimSamePart($pathOne, $pathTwo)
244 $one = explode(
'/', $pathOne);
245 $two = explode(
'/', $pathTwo);
246 while (isset($one[0]) && isset($two[0]) && $one[0] == $two[0]) {
250 return [implode(
'/', $one), implode(
'/', $two)];
getFilename($fileId, array $params=[])
elseif(isset( $params[ 'redirect_parent']))
__construct(\Magento\Framework\View\Design\FileResolution\Fallback\File $fallbackFile, \Magento\Framework\View\Design\FileResolution\Fallback\TemplateFile $fallbackTemplateFile, \Magento\Framework\View\Design\FileResolution\Fallback\LocaleFile $fallbackLocaleFile, \Magento\Framework\View\Design\FileResolution\Fallback\StaticFile $fallbackStaticFile, \Magento\Framework\View\Design\FileResolution\Fallback\EmailTemplateFile $fallbackEmailTemplateFile, \Magento\Framework\View\Asset\Repository $assetRepo)
static normalizePath($path)
getTemplateFileName($fileId, array $params=[])
getEmailTemplateFileName($fileId, array $params, $module)
getStaticFileName($fileId, array $params=[])
getLocaleFileName($file, array $params=[])
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE]
$_emailTemplateFileResolution
static offsetPath($relatedPath, $path)
static getRelatedPath($relativeTo, $path)