Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. DrupalKernel.php

function DrupalKernel::rebuildContainer

Overrides DrupalKernelInterface::rebuildContainer

File

core/lib/Drupal/Core/DrupalKernel.php, line 1140

Class

DrupalKernel
The DrupalKernel class is the core of Drupal itself.

Namespace

Drupal\Core

Code

public function rebuildContainer() {
    // Empty module properties and for them to be reloaded from scratch.
    $this->moduleList = NULL;
    $this->moduleData = [];
    $this->containerNeedsRebuild = TRUE;
    $container = $this->initializeContainer();
    // ThemeManager::render() fails without this. Normally ::preHandle() has
    // a ->loadAll() call.
    $container->get('module_handler')
        ->loadAll();
    return $container;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal