function Registry::hasThemeHookImplementation

Same name and namespace in other branches
  1. 11.x core/lib/Drupal/Core/Theme/Registry.php \Drupal\Core\Theme\Registry::hasThemeHookImplementation()

Returns whether a theme implements a given hook.

Parameters

string $theme: Name of the theme.

string $hook: Name of the hook.

Return value

bool True if the theme implements the given hook.

1 call to Registry::hasThemeHookImplementation()
Registry::processExtension in core/lib/Drupal/Core/Theme/Registry.php
Process a single implementation of hook_theme().

File

core/lib/Drupal/Core/Theme/Registry.php, line 1031

Class

Registry
Defines the theme registry service.

Namespace

Drupal\Core\Theme

Code

protected function hasThemeHookImplementation(string $theme, string $hook) : bool {
  if (!isset($this->themeHookList)) {
    $this->themeHookList = $this->keyValueFactory
      ->get('hook_data')
      ->get('theme_hook_list') ?? [];
  }
  return isset($this->themeHookList[$theme][$hook]);
}

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