function drupal_container

Retrieves the Drupal Container to standardize object construction.

Return value

Symfony\Component\DependencyInjection\ContainerInterface|bool The instance of the ContainerInterface used to set up and maintain object instances or FALSE if none exist yet.

Deprecated

This function has been replaced by the \Drupal class. Use that instead.

12 calls to drupal_container()
DrupalUnitTestBase::setUp in drupal/core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php
Sets up Drupal unit test environment.
drupal_get_filename in drupal/core/includes/bootstrap.inc
Returns and optionally sets the filename for a system resource.
drupal_get_js in drupal/core/includes/common.inc
Returns a themed presentation of all JavaScript code for the current page.
PluginInstanceTest::testPluginInstances in drupal/core/modules/views/lib/Drupal/views/Tests/PluginInstanceTest.php
Tests creating instances of every views plugin.
RestExport::initDisplay in drupal/core/modules/rest/lib/Drupal/rest/Plugin/views/display/RestExport.php

... See full list

File

drupal/core/includes/bootstrap.inc, line 2155
Functions that need to be loaded on every Drupal request.

Code

function drupal_container() {
  return Drupal::getContainer();
}