function ThemeManager::invokeAllWith

File

core/lib/Drupal/Core/Theme/ThemeManager.php, line 502

Class

ThemeManager
Provides the default implementation of a theme manager.

Namespace

Drupal\Core\Theme

Code

public function invokeAllWith(string $hook, callable $callback) : void {
  $active_theme = $this->getActiveTheme();
  $theme_keys = $this->getThemeChain($active_theme);
  foreach ($theme_keys as $theme_key) {
    $listeners = $this->getImplementationsForTheme($theme_key, $hook);
    foreach ($listeners as $listener) {
      $callback($listener, $theme_key);
    }
  }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.