function ThemeManager::invoke

File

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

Class

ThemeManager
Provides the default implementation of a theme manager.

Namespace

Drupal\Core\Theme

Code

public function invoke(string $theme, string $hook, array $args = []) {
  $listeners = $this->getImplementationsForTheme($theme, $hook);
  if ($listeners) {
    if (count($listeners) > 1) {
      throw new \LogicException("Theme {$theme} should not implement {$hook} more than once");
    }
    return reset($listeners)(...$args);
  }
}

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