function ActiveTheme::__construct
Constructs an ActiveTheme object.
Parameters
array $values: The properties of the object, keyed by the names.
File
- 
              core/lib/ Drupal/ Core/ Theme/ ActiveTheme.php, line 117 
Class
- ActiveTheme
- Defines a theme and its information needed at runtime.
Namespace
Drupal\Core\ThemeCode
public function __construct(array $values) {
  $values += [
    'path' => '',
    'engine' => 'twig',
    'owner' => 'twig',
    'logo' => '',
    'stylesheets_remove' => [],
    'libraries' => [],
    'extension' => 'html.twig',
    'base_theme_extensions' => [],
    'regions' => [],
    'libraries_override' => [],
    'libraries_extend' => [],
  ];
  $this->name = $values['name'];
  $this->logo = $values['logo'];
  $this->path = $values['path'];
  $this->engine = $values['engine'];
  $this->owner = $values['owner'];
  $this->styleSheetsRemove = $values['stylesheets_remove'];
  $this->libraries = $values['libraries'];
  $this->extension = $values['extension'];
  $this->baseThemeExtensions = $values['base_theme_extensions'];
  if (!empty($values['base_themes']) && empty($this->baseThemeExtensions)) {
    @trigger_error("The 'base_themes' key is deprecated in Drupal 8.7.0  and support for it will be removed in Drupal 9.0.0. Use 'base_theme_extensions' instead. See https://www.drupal.org/node/3019948", E_USER_DEPRECATED);
    foreach ($values['base_themes'] as $base_theme) {
      $this->baseThemeExtensions[$base_theme->getName()] = $base_theme->getExtension();
    }
  }
  $this->regions = $values['regions'];
  $this->librariesOverride = $values['libraries_override'];
  $this->librariesExtend = $values['libraries_extend'];
}Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.
