本文整理匯總了PHP中Magento\Framework\View\Design\ThemeInterface::getThemeTitle方法的典型用法代碼示例。如果您正苦於以下問題:PHP ThemeInterface::getThemeTitle方法的具體用法?PHP ThemeInterface::getThemeTitle怎麽用?PHP ThemeInterface::getThemeTitle使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Magento\Framework\View\Design\ThemeInterface
的用法示例。
在下文中一共展示了ThemeInterface::getThemeTitle方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: _createStagingTheme
/**
* Create 'staging' theme associated with current 'virtual' theme
*
* @return \Magento\Framework\View\Design\ThemeInterface
*/
protected function _createStagingTheme()
{
$stagingTheme = $this->_themeFactory->create();
$stagingTheme->setData(['parent_id' => $this->_theme->getId(), 'theme_path' => null, 'theme_title' => sprintf('%s - Staging', $this->_theme->getThemeTitle()), 'preview_image' => $this->_theme->getPreviewImage(), 'is_featured' => $this->_theme->getIsFeatured(), 'type' => \Magento\Framework\View\Design\ThemeInterface::TYPE_STAGING]);
$stagingTheme->save();
return $stagingTheme;
}
示例2: _getPhysicalTheme
/**
* Find the closest physical theme among ancestors and a theme itself
*
* @param \Magento\Framework\View\Design\ThemeInterface $theme
* @return \Magento\Theme\Model\Theme
* @throws \Magento\Framework\Exception
*/
protected function _getPhysicalTheme(\Magento\Framework\View\Design\ThemeInterface $theme)
{
$result = $theme;
while ($result->getId() && !$result->isPhysical()) {
$result = $result->getParentTheme();
}
if (!$result) {
throw new \Magento\Framework\Exception("Unable to find a physical ancestor for a theme '{$theme->getThemeTitle()}'.");
}
return $result;
}
示例3: _getVirtualThemeTitle
/**
* Get virtual theme title
*
* @param \Magento\Framework\View\Design\ThemeInterface $theme
* @return string
*/
protected function _getVirtualThemeTitle($theme)
{
$themeCopyCount = $this->_themeCollection->addAreaFilter(\Magento\Framework\App\Area::AREA_FRONTEND)->addTypeFilter(\Magento\Framework\View\Design\ThemeInterface::TYPE_VIRTUAL)->addFilter('parent_id', $theme->getId())->count();
$title = sprintf("%s - %s #%s", $theme->getThemeTitle(), __('Copy'), $themeCopyCount + 1);
return $title;
}
示例4: _getPhysicalTheme
/**
* Find the closest physical theme among ancestors and a theme itself
*
* @param \Magento\Framework\View\Design\ThemeInterface $theme
* @return \Magento\Theme\Model\Theme
* @throws \Magento\Framework\Exception\LocalizedException
*/
protected function _getPhysicalTheme(\Magento\Framework\View\Design\ThemeInterface $theme)
{
$result = $theme;
while ($result->getId() && !$result->isPhysical()) {
$result = $result->getParentTheme();
}
if (!$result) {
throw new \Magento\Framework\Exception\LocalizedException(new \Magento\Framework\Phrase('Unable to find a physical ancestor for a theme \'%1\'.', [$theme->getThemeTitle()]));
}
return $result;
}