You are here

function drupal_theme_rebuild in Drupal 8

Same name and namespace in other branches
  1. 7 includes/theme.inc \drupal_theme_rebuild()
  2. 9 core/includes/theme.inc \drupal_theme_rebuild()

Forces the system to rebuild the theme registry.

This function should be called when modules are added to the system, or when a dynamic system needs to add more theme hooks.

7 calls to drupal_theme_rebuild()
ImageStyle::flush in core/modules/image/src/Entity/ImageStyle.php
Flushes cached media for this style.
ModuleInstaller::install in core/lib/Drupal/Core/Extension/ModuleInstaller.php
Installs a given list of modules.
ModuleInstaller::uninstall in core/lib/Drupal/Core/Extension/ModuleInstaller.php
Uninstalls a given list of modules.
ThemeInstaller::themeRegistryRebuild in core/lib/Drupal/Core/Extension/ThemeInstaller.php
Wraps drupal_theme_rebuild().
ThemeTest::testPreprocessForSuggestions in core/modules/system/tests/src/Functional/Theme/ThemeTest.php
Ensures preprocess functions run even for suggestion implementations.

... See full list

File

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

Code

function drupal_theme_rebuild() {
  \Drupal::service('theme.registry')
    ->reset();
}