interface ThemeInitializationInterface (View source)

Defines an interface which contain theme initialization logic.

Methods

initTheme(string $theme_name)

Initializes a given theme.

getActiveThemeByName(string $theme_name)

Builds an active theme object.

loadActiveTheme(ActiveTheme $active_theme)

Loads a theme, so it is ready to be used.

getActiveTheme(Extension $theme, array $base_themes = [])

Builds up the active theme object from extensions.

Details

ActiveTheme initTheme(string $theme_name)

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

ActiveTheme

An active theme object instance for the given theme.

ActiveTheme getActiveThemeByName(string $theme_name)

Builds an active theme object.

Parameters

string $theme_name

The machine name of the theme.

Return Value

ActiveTheme

An active theme object instance for the given theme.

Exceptions

MissingThemeDependencyException

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.

Parameters

ActiveTheme $active_theme

The theme to load.

ActiveTheme getActiveTheme(Extension $theme, array $base_themes = [])

Builds up the active theme object from extensions.

Parameters

Extension $theme

The theme extension object.

array $base_themes

An array of extension objects of base theme and its bases. It is ordered by 'next parent first', meaning the top level of the chain will be first.

Return Value

ActiveTheme

The active theme instance for the passed in $theme.