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

Breadcrumb

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

function ContainerBuilder::getExtension

Returns an extension by alias or namespace.

Throws

LogicException if the extension is not registered

File

vendor/symfony/dependency-injection/ContainerBuilder.php, line 214

Class

ContainerBuilder
ContainerBuilder is a DI container that provides an API to easily describe services.

Namespace

Symfony\Component\DependencyInjection

Code

public function getExtension(string $name) : ExtensionInterface {
    if (isset($this->extensions[$name])) {
        return $this->extensions[$name];
    }
    if (isset($this->extensionsByNs[$name])) {
        return $this->extensionsByNs[$name];
    }
    throw new LogicException(\sprintf('Container extension "%s" is not registered.', $name));
}

API Navigation

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