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.

$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

__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.

getExtension()

Returns the extension object.

mixed
getLibraries()

Returns the libraries provided by the theme.

mixed
getStyleSheetsRemove()

Returns the removed stylesheets by the theme.

getBaseThemeExtensions()

Returns an array of base theme extension objects keyed by name.

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.

Details

__construct(array $values)

Constructs an ActiveTheme object.

Parameters

array $values

The properties of the object, keyed by the names.

string getName()

Returns the machine name of the theme.

Return Value

string

string getPath()

Returns the path to the theme directory.

Return Value

string

string getEngine()

Returns the theme engine.

Return Value

string

mixed getOwner()

Returns the path to the theme engine for root themes.

Return Value

mixed

See also

ThemeExtensionList::doList

Extension getExtension()

Returns the extension object.

Return Value

Extension

mixed getLibraries()

Returns the libraries provided by the theme.

Return Value

mixed

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.

Remove in Drupal 10.0.x.

Return Value

mixed

The removed stylesheets.

See also

https://www.drupal.org/node/2497313

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.

Return Value

Extension[]

Returns the logo provided by the theme.

Return Value

string

The logo path.

string[] getRegions()

The regions used by the theme.

Return Value

string[]

The list of region machine names supported by the theme.

See also

system_region_list()

array getLibrariesOverride()

Returns the libraries or library assets overridden by the active theme.

Return Value

array

The list of libraries overrides.

array getLibrariesExtend()

Returns the libraries extended by the active theme.

Return Value

array

The list of libraries-extend definitions.