You are here

public function ThemeEvent::addNewTheme in Hook Event Dispatcher 3.x

Same name and namespace in other branches
  1. 8.2 modules/core_event_dispatcher/src/Event/Theme/ThemeEvent.php \Drupal\core_event_dispatcher\Event\Theme\ThemeEvent::addNewTheme()

Add new theme.

Have a look at the return statement.

Parameters

string $theme: Theme hook.

array $information: Information array.

Throws

\RuntimeException

See also

\hook_theme()

1 call to ThemeEvent::addNewTheme()
ThemeEvent::addNewThemes in modules/core_event_dispatcher/src/Event/Theme/ThemeEvent.php
Add new themes.

File

modules/core_event_dispatcher/src/Event/Theme/ThemeEvent.php, line 86

Class

ThemeEvent
Class ThemeEvent.

Namespace

Drupal\core_event_dispatcher\Event\Theme

Code

public function addNewTheme($theme, array $information) {
  if (empty($information['path'])) {
    throw new RuntimeException('Missing path in the information array. ThemeEvent needs the path to be set manually, to have a proper default theme implementation. See \\hook_theme() for more information.');
  }
  $this->newThemes[$theme] = $information;
}