function theme_get_registry

Get the theme registry.

Parameters

bool $complete: Optional boolean to indicate whether to return the complete theme registry array or an instance of the Drupal\Core\Utility\ThemeRegistry class. If TRUE, the complete theme registry array will be returned. This is useful if you want to foreach over the whole registry, use array_* functions or inspect it in a debugger. If FALSE, an instance of the Drupal\Core\Utility\ThemeRegistry class will be returned, this provides an ArrayObject which allows it to be accessed with array syntax and isset(), and should be more lightweight than the full registry. Defaults to TRUE.

Return value

The complete theme registry array, or an instance of the Drupal\Core\Utility\ThemeRegistry class.

7 calls to theme_get_registry()
contextual_preprocess in drupal/core/modules/contextual/contextual.module
Implements hook_preprocess().
DisplayPluginBase::buildOptionsForm in drupal/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php
Provide the default form for setting options.
hook_preprocess in drupal/core/modules/system/theme.api.php
Preprocess theme variables for templates.
l in drupal/core/includes/common.inc
Formats an internal or external URL link as an HTML anchor tag.
theme in drupal/core/includes/theme.inc
Generates themed output.

... See full list

1 string reference to 'theme_get_registry'
drupal_theme_rebuild in drupal/core/includes/theme.inc
Force the system to rebuild the theme registry; this should be called when modules are added to the system, or when a dynamic system needs to add more theme hooks.

File

drupal/core/includes/theme.inc, line 261
The theme system, which controls the output of Drupal.

Code

function theme_get_registry($complete = TRUE) {

  // Use the advanced drupal_static() pattern, since this is called very often.
  static $drupal_static_fast;
  if (!isset($drupal_static_fast)) {
    $drupal_static_fast['registry'] =& drupal_static('theme_get_registry');
  }
  $theme_registry =& $drupal_static_fast['registry'];

  // Initialize the theme, if this is called early in the bootstrap, or after
  // static variables have been reset.
  if (!is_array($theme_registry)) {
    drupal_theme_initialize();
    $theme_registry = array();
  }
  $key = (int) $complete;
  if (!isset($theme_registry[$key])) {
    list($callback, $arguments) = _theme_registry_callback();
    if (!$complete) {
      $arguments[] = FALSE;
    }
    $theme_registry[$key] = call_user_func_array($callback, $arguments);
  }
  return $theme_registry[$key];
}