public function ThemeRegistry::has

public ThemeRegistry::has($key)

Returns whether data exists for this key.

Parameters

string $key: Key that identifies the data.

Overrides CacheCollector::has

File

core/lib/Drupal/Core/Utility/ThemeRegistry.php, line 94

Class

ThemeRegistry
Builds the run-time theme registry.

Namespace

Drupal\Core\Utility

Code

public function has($key) {
  // Since the theme registry allows for theme hooks to be requested that
  // are not registered, just check the existence of the key in the registry.
  // Use array_key_exists() here since a NULL value indicates that the theme
  // hook exists but has not yet been requested.
  return array_key_exists($key, $this->storage);
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Utility!ThemeRegistry.php/function/ThemeRegistry::has/8.1.x