ThemeManagerInterface
interface ThemeManagerInterface (View source)
Provides a high level access to the active theme and methods to use it.
Beside the active theme it provides a wrapper around _theme as well as the alter functionality for themes.
Methods
Generates themed output.
Determines whether there is an active theme.
Resets the current active theme.
Passes alterable variables to specific $theme_TYPE_alter() implementations.
Provides an alter hook for a specific theme.
Details
string|MarkupInterface
render(string $hook, array $variables)
Generates themed output.
See the @link themeable Default theme implementations topic @endlink for details.
ActiveTheme
getActiveTheme(RouteMatchInterface $route_match = NULL)
Returns the active theme object.
bool
hasActiveTheme()
Determines whether there is an active theme.
$this
resetActiveTheme()
Resets the current active theme.
Note: This method should not be used in common cases, just in special cases like tests.
$this
setActiveTheme(ActiveTheme $active_theme)
Sets the current active theme manually.
Note: This method should not be used in common cases, just in special cases like tests.
alter(string|array $type, mixed $data, mixed $context1 = NULL, mixed $context2 = NULL)
Passes alterable variables to specific $theme_TYPE_alter() implementations.
Executes an alter hook on the current theme. It also invokes alter hooks for all base themes.
$theme specifies the theme name of the active theme and all its base themes.
This dispatch function hands off the passed-in variables to type-specific $theme_TYPE_alter() implementations in the active theme. It ensures a consistent interface for all altering operations.
A maximum of 2 alterable arguments is supported. In case more arguments need to be passed and alterable, modules provide additional variables assigned by reference in the last $context argument:
alterForTheme(ActiveTheme $theme, string|array $type, mixed $data, mixed $context1 = NULL, mixed $context2 = NULL)
Provides an alter hook for a specific theme.
Similar to ::alter, it also invokes the alter hooks for the base themes.