Same name and namespace in other branches
  1. 8.9.x core/lib/Drupal/Core/Theme/Registry.php \Drupal\Core\Theme\Registry::registry
  2. 9 core/lib/Drupal/Core/Theme/Registry.php \Drupal\Core\Theme\Registry::registry

The complete theme registry.

An array of theme registries, keyed by the theme name. Each registry is an associative array keyed by theme hook names, whose values are associative arrays containing the aggregated hook definition:

In case of a theme base hook, one of the following:

  • variables: An associative array whose keys are variable names and whose values are default values of the variables to use for this theme hook.
  • render element: A string denoting the name of the variable name, in which the render element for this theme hook is provided.

In case of a theme template file:

  • path: The path to the template file to use. Defaults to the subdirectory 'templates' of the path of the extension implementing hook_theme(); e.g., 'core/modules/node/templates' for Node module.
  • template: The basename of the template file to use, without extension (as the extension is specific to the theme engine). The template file is in the directory defined by 'path'.
  • template_file: A full path and file name to a template file to use. Allows any extension to override the effective template file.
  • engine: The theme engine to use for the template file.

For any registered theme hook, including theme hook suggestions:

  • preprocess: An array of theme variable preprocess callbacks to invoke before invoking final theme variable processors.
  • process: An array of theme variable process callbacks to invoke before invoking the actual template.

Type: array

File

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

Class

Registry
Defines the theme registry service.

Namespace

Drupal\Core\Theme

Code

protected $registry = [];