ActiveTheme
class ActiveTheme (View source)
Defines a theme and its information needed at runtime.
The theme manager will store the active theme object.
Properties
| protected string | $name | The machine name of the active theme. |
|
| protected string | $logo | The path to the logo. |
|
| protected string | $path | The path to the theme. |
|
| protected string | $engine | The engine of the theme. |
|
| protected string | $owner | The path to the theme engine for root themes. |
|
| protected Extension[] | $baseThemeExtensions | An array of base theme extension objects keyed by name. |
|
| protected Extension | $extension | The extension object. |
|
| protected array | $styleSheetsRemove | The stylesheets which are set to be removed by the theme. |
|
| protected array | $libraries | The libraries provided by the theme. |
|
| protected array | $regions | The regions provided by the theme. |
|
| protected array | $librariesOverride | The libraries or library assets overridden by the theme. |
|
| protected array | $librariesExtend | The list of libraries-extend definitions. |
Methods
Constructs an ActiveTheme object.
Returns the machine name of the theme.
Returns the path to the theme directory.
Returns the theme engine.
Returns the path to the theme engine for root themes.
Returns the extension object.
Returns the libraries provided by the theme.
Returns the removed stylesheets by the theme.
Returns an array of base theme extension objects keyed by name.
Returns the logo provided by the theme.
The regions used by the theme.
Returns the libraries or library assets overridden by the active theme.
Returns the libraries extended by the active theme.
Details
__construct(array $values)
Constructs an ActiveTheme object.
string
getName()
Returns the machine name of the theme.
string
getPath()
Returns the path to the theme directory.
string
getEngine()
Returns the theme engine.
mixed
getOwner()
Returns the path to the theme engine for root themes.
Extension
getExtension()
Returns the extension object.
mixed
getLibraries()
Returns the libraries provided by the theme.
mixed
getStyleSheetsRemove()
| internal |
Returns the removed stylesheets by the theme.
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.
Extension[]
getBaseThemeExtensions()
Returns an array of base theme extension objects keyed by name.
The order starts with the base theme of $this and ends with the root of the dependency chain.
string
getLogo()
Returns the logo provided by the theme.
string[]
getRegions()
The regions used by the theme.
array
getLibrariesOverride()
Returns the libraries or library assets overridden by the active theme.
array
getLibrariesExtend()
Returns the libraries extended by the active theme.