You are here

public function ThemeManager::setActiveTheme in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/Theme/ThemeManager.php \Drupal\Core\Theme\ThemeManager::setActiveTheme()

Sets the current active theme manually.

Note: This method should not be used in common cases, just in special cases like tests.

Parameters

\Drupal\Core\Theme\ActiveTheme $active_theme: The new active theme.

Return value

$this

Overrides ThemeManagerInterface::setActiveTheme

File

core/lib/Drupal/Core/Theme/ThemeManager.php, line 125
Contains \Drupal\Core\Theme\ThemeManager.

Class

ThemeManager
Provides the default implementation of a theme manager.

Namespace

Drupal\Core\Theme

Code

public function setActiveTheme(ActiveTheme $active_theme) {
  $this->activeTheme = $active_theme;
  if ($active_theme) {
    $this->themeInitialization
      ->loadActiveTheme($active_theme);
  }
  return $this;
}