function ThemeInitialization::loadActiveTheme
Same name in other branches
- 9 core/lib/Drupal/Core/Theme/ThemeInitialization.php \Drupal\Core\Theme\ThemeInitialization::loadActiveTheme()
- 10 core/lib/Drupal/Core/Theme/ThemeInitialization.php \Drupal\Core\Theme\ThemeInitialization::loadActiveTheme()
- 11.x core/lib/Drupal/Core/Theme/ThemeInitialization.php \Drupal\Core\Theme\ThemeInitialization::loadActiveTheme()
Overrides ThemeInitializationInterface::loadActiveTheme
1 call to ThemeInitialization::loadActiveTheme()
- ThemeInitialization::initTheme in core/
lib/ Drupal/ Core/ Theme/ ThemeInitialization.php - Initializes a given theme.
File
-
core/
lib/ Drupal/ Core/ Theme/ ThemeInitialization.php, line 136
Class
- ThemeInitialization
- Provides the theme initialization logic.
Namespace
Drupal\Core\ThemeCode
public function loadActiveTheme(ActiveTheme $active_theme) {
// Initialize the theme.
if ($theme_engine = $active_theme->getEngine()) {
// Include the engine.
include_once $this->root . '/' . $active_theme->getOwner();
if (function_exists($theme_engine . '_init')) {
foreach ($active_theme->getBaseThemeExtensions() as $base) {
call_user_func($theme_engine . '_init', $base);
}
call_user_func($theme_engine . '_init', $active_theme->getExtension());
}
}
else {
// include non-engine theme files
foreach ($active_theme->getBaseThemeExtensions() as $base) {
// Include the theme file or the engine.
if ($base->owner) {
include_once $this->root . '/' . $base->owner;
}
}
// and our theme gets one too.
if ($active_theme->getOwner()) {
include_once $this->root . '/' . $active_theme->getOwner();
}
}
// Always include Twig as the default theme engine.
include_once $this->root . '/core/themes/engines/twig/twig.engine';
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.