本文整理匯總了PHP中Magento\Framework\View\Design\ThemeInterface::getThemePath方法的典型用法代碼示例。如果您正苦於以下問題:PHP ThemeInterface::getThemePath方法的具體用法?PHP ThemeInterface::getThemePath怎麽用?PHP ThemeInterface::getThemePath使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Magento\Framework\View\Design\ThemeInterface
的用法示例。
在下文中一共展示了ThemeInterface::getThemePath方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: resolve
/**
* {@inheritdoc}
*/
public function resolve($type, $file, $area = null, ThemeInterface $theme = null, $locale = null, $module = null)
{
self::assertFilePathFormat($file);
$themePath = $theme ? $theme->getThemePath() : '';
$path = $this->cache->getFromCache($type, $file, $area, $themePath, $locale, $module);
if (false !== $path) {
$path = $path ? $this->rootDirectory->getAbsolutePath($path) : false;
} else {
$params = ['area' => $area, 'theme' => $theme, 'locale' => $locale];
foreach ($params as $key => $param) {
if ($param === null) {
unset($params[$key]);
}
}
if (!empty($module)) {
list($params['namespace'], $params['module']) = explode('_', $module, 2);
}
$path = $this->resolveFile($this->rulePool->getRule($type), $file, $params);
$cachedValue = $path ? $this->rootDirectory->getRelativePath($path) : '';
$this->cache->saveToCache($cachedValue, $type, $file, $area, $themePath, $locale, $module);
}
return $path;
}
示例2: setTheme
/**
* {@inheritdoc}
*/
public function setTheme(\Magento\Framework\View\Design\ThemeInterface $theme)
{
$this->_theme = $theme;
$this->setData('theme_id', $theme->getId());
$this->setData('theme_path', $theme->getThemePath());
return $this;
}
示例3: getThemePath
/**
* {@inheritdoc}
*/
public function getThemePath(\Magento\Framework\View\Design\ThemeInterface $theme)
{
$themePath = $theme->getThemePath();
if (!$themePath) {
$themeId = $theme->getId();
if ($themeId) {
$themePath = self::PUBLIC_THEME_DIR . $themeId;
} else {
$themePath = self::PUBLIC_VIEW_DIR;
}
}
return $themePath;
}
示例4: hasTheme
/**
* Checks that a theme present in filesystem collection
*
* @param ThemeInterface $theme
* @return bool
*/
public function hasTheme(ThemeInterface $theme)
{
$themeItems = $this->getItems();
return $theme->getThemePath() && isset($themeItems[$theme->getFullPath()]);
}