function DrupalKernel::getContainer

Same name and namespace in other branches
  1. 11.x core/lib/Drupal/Core/DrupalKernel.php \Drupal\Core\DrupalKernel::getContainer()
  2. 10 core/lib/Drupal/Core/DrupalKernel.php \Drupal\Core\DrupalKernel::getContainer()
  3. 8.9.x core/lib/Drupal/Core/DrupalKernel.php \Drupal\Core\DrupalKernel::getContainer()

Gets the current container.

Return value

\Symfony\Component\DependencyInjection\ContainerInterface A ContainerInterface instance.

Overrides DrupalKernelInterface::getContainer

File

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

Class

DrupalKernel
The DrupalKernel class is the core of Drupal itself.

Namespace

Drupal\Core

Code

public function getContainer() {
  return $this->container;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.