function ThemeRegistry::get

Same name in other branches
  1. 9 core/lib/Drupal/Core/Utility/ThemeRegistry.php \Drupal\Core\Utility\ThemeRegistry::get()
  2. 8.9.x core/lib/Drupal/Core/Utility/ThemeRegistry.php \Drupal\Core\Utility\ThemeRegistry::get()
  3. 11.x core/lib/Drupal/Core/Utility/ThemeRegistry.php \Drupal\Core\Utility\ThemeRegistry::get()

Overrides CacheCollector::get

File

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

Class

ThemeRegistry
Builds the run-time theme registry.

Namespace

Drupal\Core\Utility

Code

public function get($key) {
    // If the offset is set but empty, it is a registered theme hook that has
    // not yet been requested. Offsets that do not exist at all were not
    // registered in hook_theme().
    if (isset($this->storage[$key])) {
        return $this->storage[$key];
    }
    elseif (array_key_exists($key, $this->storage)) {
        return $this->resolveCacheMiss($key);
    }
}

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