ThemeHandler::addTheme

public ThemeHandler::addTheme(Extension $theme)

Adds a theme extension to the internal listing.

Parameters

\Drupal\Core\Extension\Extension $theme: The theme extension.

Overrides ThemeHandlerInterface::addTheme

File

core/lib/Drupal/Core/Extension/ThemeHandler.php, line 200

Class

ThemeHandler
Default theme handler using the config system to store installation statuses.

Namespace

Drupal\Core\Extension

Code

public function addTheme(Extension $theme) {
  if (!empty($theme->info['libraries'])) {
    foreach ($theme->info['libraries'] as $library => $name) {
      $theme->libraries[$library] = $name;
    }
  }
  if (isset($theme->info['engine'])) {
    $theme->engine = $theme->info['engine'];
  }
  if (isset($theme->info['base theme'])) {
    $theme->base_theme = $theme->info['base theme'];
  }
  $this->list[$theme->getName()] = $theme;
}
doc_Drupal
2016-10-29 09:47:57
Comments
Leave a Comment

Please login to continue.