You are here

public function ThemeHandler::addTheme in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/Extension/ThemeHandler.php \Drupal\Core\Extension\ThemeHandler::addTheme()

Adds a theme extension to the internal listing.

Parameters

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

Overrides ThemeHandlerInterface::addTheme

2 calls to ThemeHandler::addTheme()
ThemeHandler::listInfo in core/lib/Drupal/Core/Extension/ThemeHandler.php
Returns a list of currently installed themes.
ThemeHandler::refreshInfo in core/lib/Drupal/Core/Extension/ThemeHandler.php
Refreshes the theme info data of currently installed themes.

File

core/lib/Drupal/Core/Extension/ThemeHandler.php, line 202
Contains \Drupal\Core\Extension\ThemeHandler.

Class

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

Namespace

Drupal\Core\Extension

Code

public function addTheme(Extension $theme) {
  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;
}