function ThemeInitialization::initTheme
Same name and namespace in other branches
- 8.9.x core/lib/Drupal/Core/Theme/ThemeInitialization.php \Drupal\Core\Theme\ThemeInitialization::initTheme()
- 10 core/lib/Drupal/Core/Theme/ThemeInitialization.php \Drupal\Core\Theme\ThemeInitialization::initTheme()
- 11.x core/lib/Drupal/Core/Theme/ThemeInitialization.php \Drupal\Core\Theme\ThemeInitialization::initTheme()
Initializes a given theme.
This loads the active theme, for example include its engine file.
Parameters
string $theme_name: The machine name of the theme.
Return value
\Drupal\Core\Theme\ActiveTheme An active theme object instance for the given theme.
Overrides ThemeInitializationInterface::initTheme
File
-
core/
lib/ Drupal/ Core/ Theme/ ThemeInitialization.php, line 72
Class
- ThemeInitialization
- Provides the theme initialization logic.
Namespace
Drupal\Core\ThemeCode
public function initTheme($theme_name) {
$active_theme = $this->getActiveThemeByName($theme_name);
$this->loadActiveTheme($active_theme);
return $active_theme;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.