ThemeInitialization
class ThemeInitialization implements ThemeInitializationInterface (View source)
Provides the theme initialization logic.
Properties
| protected ThemeHandlerInterface | $themeHandler | The theme handler. |
|
| protected CacheBackendInterface | $cache | The cache backend to use for the active theme. |
|
| protected string | $root | The app root. |
|
| protected array | $extensions | The extensions that might be attaching assets. |
|
| protected ModuleHandlerInterface | $moduleHandler | The module handler. |
Methods
Constructs a new ThemeInitialization object.
Initializes a given theme.
Builds an active theme object.
Builds up the active theme object from extensions.
Gets all extensions.
Gets CSS file where tokens have been resolved.
Prepares stylesheets-remove specified in the *.info.yml file.
Details
__construct(string $root, ThemeHandlerInterface $theme_handler, CacheBackendInterface $cache, ModuleHandlerInterface $module_handler)
Constructs a new ThemeInitialization object.
ActiveTheme
initTheme(string $theme_name)
Initializes a given theme.
This loads the active theme, for example include its engine file.
ActiveTheme
getActiveThemeByName(string $theme_name)
Builds an active theme object.
loadActiveTheme(ActiveTheme $active_theme)
Loads a theme, so it is ready to be used.
Loading a theme includes loading and initializing the engine, each base theme and its engines.
ActiveTheme
getActiveTheme(Extension $theme, array $base_themes = [])
Builds up the active theme object from extensions.
protected array
getExtensions()
Gets all extensions.
protected string
resolveStyleSheetPlaceholders(string $css_file)
Gets CSS file where tokens have been resolved.
protected string[]
prepareStylesheetsRemove(Extension $theme, Extension[] $base_themes)
| internal |
Prepares stylesheets-remove specified in the *.info.yml file.
This method is used as a BC layer to access the contents of the deprecated stylesheets-remove key in theme info.yml files. It will be removed once it is no longer needed in Drupal 10.