Registry::$registry
Same name in other branches
- 9 core/lib/Drupal/Core/Theme/Registry.php \Drupal\Core\Theme\Registry::registry
- 8.9.x core/lib/Drupal/Core/Theme/Registry.php \Drupal\Core\Theme\Registry::registry
- 11.x 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.
- 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.
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 85
Class
- Registry
- Defines the theme registry service.
Namespace
Drupal\Core\ThemeCode
protected $registry = [];
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.