You are here

public function ThemeEvent::addNewTheme in Hook Event Dispatcher 8

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 src/Event/Theme/ThemeEvent.php
Add new themes.

File

src/Event/Theme/ThemeEvent.php, line 87

Class

ThemeEvent
Class ThemeEvent.

Namespace

Drupal\hook_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;
}