You are here

protected property Registry::$registry in Drupal 9

Same name and namespace in other branches
  1. 8 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:

  • type: The type of the extension the original theme hook originates from; e.g., 'module' for theme hook 'node' of Node module.
  • name: The name of the extension the original theme hook originates from; e.g., 'node' for theme hook 'node' of Node module.
  • theme path: The effective \Drupal\Core\Theme\ActiveTheme::getPath() during \Drupal\Core\Theme\ThemeManagerInterface::render(), available as 'directory' variable in templates. For functions, it should point to the respective theme. For templates, it should point to the directory that contains the template.
  • includes: (optional) An array of include files to load when the theme hook is executed by \Drupal\Core\Theme\ThemeManagerInterface::render().
  • file: (optional) A filename to add to 'includes', either prefixed with the value of 'path', or the path of the extension implementing hook_theme().

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.

In case of a theme function:

  • function: The function name to call to generate the output.

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 theme function or template.

Type: array

File

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

Class

Registry
Defines the theme registry service.

Namespace

Drupal\Core\Theme

Code

protected $registry = [];