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


PHP ThemeInterface::getParentTheme方法代碼示例

本文整理匯總了PHP中Magento\Framework\View\Design\ThemeInterface::getParentTheme方法的典型用法代碼示例。如果您正苦於以下問題:PHP ThemeInterface::getParentTheme方法的具體用法?PHP ThemeInterface::getParentTheme怎麽用?PHP ThemeInterface::getParentTheme使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Magento\Framework\View\Design\ThemeInterface的用法示例。


在下文中一共展示了ThemeInterface::getParentTheme方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getPhysicalTheme

 /**
  * Get 'physical' theme
  *
  * @return \Magento\Framework\View\Design\ThemeInterface
  */
 public function getPhysicalTheme()
 {
     /** @var $parentTheme \Magento\Framework\View\Design\ThemeInterface */
     $parentTheme = $this->_theme->getParentTheme();
     while ($parentTheme && !$parentTheme->isPhysical()) {
         $parentTheme = $parentTheme->getParentTheme();
     }
     if (!$parentTheme || !$parentTheme->getId()) {
         return null;
     }
     return $parentTheme;
 }
開發者ID:pradeep-wagento,項目名稱:magento2,代碼行數:17,代碼來源:Virtual.php

示例2: __construct

 /**
  * @param \Magento\Framework\View\DesignInterface $design
  * @param \Magento\Framework\Filesystem $filesystem
  * @param \Magento\Framework\Event\ManagerInterface $eventDispatcher
  * @param \Magento\Framework\View\ConfigInterface $viewConfig
  * @param \Magento\DesignEditor\Model\Config\Control\AbstractControl $configuration
  * @param \Magento\Framework\View\Design\ThemeInterface $theme
  * @param \Magento\Framework\View\Design\ThemeInterface $parentTheme
  */
 public function __construct(\Magento\Framework\View\DesignInterface $design, \Magento\Framework\Filesystem $filesystem, \Magento\Framework\Event\ManagerInterface $eventDispatcher, \Magento\Framework\View\ConfigInterface $viewConfig, \Magento\DesignEditor\Model\Config\Control\AbstractControl $configuration = null, \Magento\Framework\View\Design\ThemeInterface $theme = null, \Magento\Framework\View\Design\ThemeInterface $parentTheme = null)
 {
     $this->_configuration = $configuration;
     $this->_theme = $theme;
     $this->_parentTheme = $parentTheme ?: $theme->getParentTheme();
     $this->_design = $design;
     $this->_filesystem = $filesystem;
     $this->_eventDispatcher = $eventDispatcher;
     $this->_viewConfigLoader = $viewConfig;
     $this->_initViewConfigs()->_loadControlsData();
 }
開發者ID:shabbirvividads,項目名稱:magento2,代碼行數:20,代碼來源:Configuration.php

示例3: updateFromStagingTheme

 /**
  * Copy changes from 'staging' theme
  *
  * @return \Magento\Framework\View\Design\Theme\Domain\StagingInterface
  */
 public function updateFromStagingTheme()
 {
     $this->_themeCopyService->copy($this->_theme, $this->_theme->getParentTheme());
     return $this;
 }
開發者ID:pradeep-wagento,項目名稱:magento2,代碼行數:10,代碼來源:Staging.php

示例4: getParentConfigs

 /**
  * Recursively add parent theme configs
  *
  * @param ThemeInterface $theme
  * @param array $iterator
  * @param int $index
  * @return array
  */
 private function getParentConfigs(ThemeInterface $theme, array $iterator, $index = 0)
 {
     if ($theme->getParentTheme() && $theme->isPhysical()) {
         $parentDesignPath = $this->resolver->resolve(RulePool::TYPE_FILE, 'etc/view.xml', $this->area, $theme->getParentTheme());
         $parentDom = new \DOMDocument();
         $parentDom->load($parentDesignPath);
         $iterator[$index] = $parentDom->saveXML();
         $iterator = $this->getParentConfigs($theme->getParentTheme(), $iterator, ++$index);
     }
     return $iterator;
 }
開發者ID:Doability,項目名稱:magento2dev,代碼行數:19,代碼來源:FileResolver.php

示例5: _getResetParentId

 /**
  * Reset parent themes by type
  *
  * @param ThemeInterface $theme
  * @return int|null
  */
 protected function _getResetParentId(ThemeInterface $theme)
 {
     $parentTheme = $theme->getParentTheme();
     while ($parentTheme) {
         foreach ($this->_allowedRelations as $typesSequence) {
             list($parentType, $childType) = $typesSequence;
             if ($theme->getType() == $childType && $parentTheme->getType() == $parentType) {
                 return $parentTheme->getId();
             }
         }
         $parentTheme = $parentTheme->getParentTheme();
     }
     return null;
 }
開發者ID:pradeep-wagento,項目名稱:magento2,代碼行數:20,代碼來源:Registration.php


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