当前位置: 首页>>代码示例>>PHP>>正文


PHP ThemeHandlerInterface::getTheme方法代码示例

本文整理汇总了PHP中Drupal\Core\Extension\ThemeHandlerInterface::getTheme方法的典型用法代码示例。如果您正苦于以下问题:PHP ThemeHandlerInterface::getTheme方法的具体用法?PHP ThemeHandlerInterface::getTheme怎么用?PHP ThemeHandlerInterface::getTheme使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Drupal\Core\Extension\ThemeHandlerInterface的用法示例。


在下文中一共展示了ThemeHandlerInterface::getTheme方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: processDefinition

 /**
  * {@inheritdoc}
  */
 public function processDefinition(&$definition, $plugin_id)
 {
     parent::processDefinition($definition, $plugin_id);
     // Add the module or theme path to the 'path'.
     if ($this->moduleHandler->moduleExists($definition['provider'])) {
         $definition['provider_type'] = 'module';
         $base_path = $this->moduleHandler->getModule($definition['provider'])->getPath();
     } elseif ($this->themeHandler->themeExists($definition['provider'])) {
         $definition['provider_type'] = 'theme';
         $base_path = $this->themeHandler->getTheme($definition['provider'])->getPath();
     } else {
         $base_path = '';
     }
     $definition['path'] = !empty($definition['path']) ? $base_path . '/' . $definition['path'] : $base_path;
     // Add the path to the icon filename.
     if (!empty($definition['icon'])) {
         $definition['icon'] = $definition['path'] . '/' . $definition['icon'];
     }
     // If 'template' is set, then we'll derive 'template_path' and 'theme'.
     if (!empty($definition['template'])) {
         $template_parts = explode('/', $definition['template']);
         $definition['template'] = array_pop($template_parts);
         $definition['theme'] = strtr($definition['template'], '-', '_');
         $definition['template_path'] = $definition['path'];
         if (count($template_parts) > 0) {
             $definition['template_path'] .= '/' . implode('/', $template_parts);
         }
     }
     // If 'css' is set, then we'll derive 'library'.
     if (!empty($definition['css'])) {
         $definition['css'] = $definition['path'] . '/' . $definition['css'];
         $definition['library'] = 'layout_plugin/' . $plugin_id;
     }
     // Generate the 'region_names' key from the 'regions' key.
     $definition['region_names'] = array();
     if (!empty($definition['regions']) && is_array($definition['regions'])) {
         foreach ($definition['regions'] as $region_id => $region_definition) {
             $definition['region_names'][$region_id] = $region_definition['label'];
         }
     }
 }
开发者ID:AllieRays,项目名称:debugging-drupal-8,代码行数:44,代码来源:LayoutPluginManager.php

示例2: getGroupProviders

 /**
  * {@inheritdoc}
  */
 public function getGroupProviders($group)
 {
     $providers = array();
     $breakpoints = $this->getBreakpointsByGroup($group);
     foreach ($breakpoints as $breakpoint) {
         $provider = $breakpoint->getProvider();
         $extension = FALSE;
         if ($this->moduleHandler->moduleExists($provider)) {
             $extension = $this->moduleHandler->getModule($provider);
         } elseif ($this->themeHandler->themeExists($provider)) {
             $extension = $this->themeHandler->getTheme($provider);
         }
         if ($extension) {
             $providers[$extension->getName()] = $extension->getType();
         }
     }
     return $providers;
 }
开发者ID:ddrozdik,项目名称:dmaps,代码行数:21,代码来源:BreakpointManager.php


注:本文中的Drupal\Core\Extension\ThemeHandlerInterface::getTheme方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。