8.2.x theme.inc theme_get_registry($complete = TRUE)
8.0.x theme.inc theme_get_registry($complete = TRUE)
8.1.x theme.inc theme_get_registry($complete = TRUE)
8.3.x theme.inc theme_get_registry($complete = TRUE)
6.x theme.inc theme_get_registry($registry = NULL)
7.x theme.inc theme_get_registry($complete = TRUE)

Gets 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.

1 call to theme_get_registry()
hook_preprocess in core/lib/Drupal/Core/Render/theme.api.php
Preprocess theme variables for templates.

File

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

Code

function theme_get_registry($complete = TRUE) {
  $theme_registry = \Drupal::service('theme.registry');
  if ($complete) {
    return $theme_registry->get();
  }
  else {
    return $theme_registry->getRuntime();
  }
}