當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ThemeInterface::getThemePath方法代碼示例

本文整理匯總了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;
 }
開發者ID:vasiljok,項目名稱:magento2,代碼行數:26,代碼來源:Simple.php

示例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;
 }
開發者ID:shabbirvividads,項目名稱:magento2,代碼行數:10,代碼來源:File.php

示例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;
 }
開發者ID:Atlis,項目名稱:docker-magento2,代碼行數:16,代碼來源:Design.php

示例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()]);
 }
開發者ID:kidaa30,項目名稱:magento2-platformsh,代碼行數:11,代碼來源:Collection.php


注:本文中的Magento\Framework\View\Design\ThemeInterface::getThemePath方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。