Drupal::setContainer

public static Drupal::setContainer(ContainerInterface $container) Sets a new global container. Parameters \Symfony\Component\DependencyInjection\ContainerInterface $container: A new container instance to replace the current. File core/lib/Drupal.php, line 109 Contains \Drupal. Class Drupal Static Service Container wrapper. Code public static function setContainer(ContainerInterface $container) { static::$container = $container; }

Drupal::service

public static Drupal::service($id) Retrieves a service from the container. Use this method if the desired service is not one of those with a dedicated accessor method below. If it is listed below, those methods are preferred as they can return useful type hints. Parameters string $id: The ID of the service to retrieve. Return value mixed The specified service. File core/lib/Drupal.php, line 157 Contains \Drupal. Class Drupal Static Service Container wrapper. Code public static function

Drupal::routeMatch

public static Drupal::routeMatch() Retrieves the currently active route match object. Return value \Drupal\Core\Routing\RouteMatchInterface The currently active route match object. File core/lib/Drupal.php, line 237 Contains \Drupal. Class Drupal Static Service Container wrapper. Code public static function routeMatch() { return static::getContainer()->get('current_route_match'); }

Drupal::root

public static Drupal::root() Gets the app root. Return value string File core/lib/Drupal.php, line 180 Contains \Drupal. Class Drupal Static Service Container wrapper. Code public static function root() { return static::getContainer()->get('app.root'); }

Drupal::requestStack

public static Drupal::requestStack() Retrives the request stack. Return value \Symfony\Component\HttpFoundation\RequestStack The request stack File core/lib/Drupal.php, line 227 Contains \Drupal. Class Drupal Static Service Container wrapper. Code public static function requestStack() { return static::getContainer()->get('request_stack'); }

Drupal::request

public static Drupal::request() Retrieves the currently active request object. Note: The use of this wrapper in particular is especially discouraged. Most code should not need to access the request directly. Doing so means it will only function when handling an HTTP request, and will require special modification or wrapping when run from a command line tool, from certain queue processors, or from automated tests. If code must access the request, it is considerably better to register an object w

Drupal::queue

public static Drupal::queue($name, $reliable = FALSE) Returns a queue for the given queue name. The following values can be set in your settings.php file's $settings array to define which services are used for queues: queue_reliable_service_$name: The container service to use for the reliable queue $name. queue_service_$name: The container service to use for the queue $name. queue_default: The container service to use by default for queues without overrides. This defaults to 'queue.database'

Drupal::pathValidator

public static Drupal::pathValidator() Returns the path validator. Return value \Drupal\Core\Path\PathValidatorInterface File core/lib/Drupal.php, line 690 Contains \Drupal. Class Drupal Static Service Container wrapper. Code public static function pathValidator() { return static::getContainer()->get('path.validator'); }

Drupal::moduleHandler

public static Drupal::moduleHandler() Returns the module handler. Return value \Drupal\Core\Extension\ModuleHandlerInterface File core/lib/Drupal.php, line 470 Contains \Drupal. Class Drupal Static Service Container wrapper. Code public static function moduleHandler() { return static::getContainer()->get('module_handler'); }

Drupal::menuTree

public static Drupal::menuTree() Returns the menu tree. Return value \Drupal\Core\Menu\MenuLinkTreeInterface The menu tree. File core/lib/Drupal.php, line 681 Contains \Drupal. Class Drupal Static Service Container wrapper. Code public static function menuTree() { return static::getContainer()->get('menu.link_tree'); }