You are here

public function TwigExtenderServiceProvider::alter in Twig Extender 8.3

Same name and namespace in other branches
  1. 8.4 src/TwigExtenderServiceProvider.php \Drupal\twig_extender\TwigExtenderServiceProvider::alter()
  2. 8 src/TwigExtenderServiceProvider.php \Drupal\twig_extender\TwigExtenderServiceProvider::alter()
  3. 8.2 src/TwigExtenderServiceProvider.php \Drupal\twig_extender\TwigExtenderServiceProvider::alter()
  4. 4.x src/TwigExtenderServiceProvider.php \Drupal\twig_extender\TwigExtenderServiceProvider::alter()

Modifies existing service definitions.

Parameters

ContainerBuilder $container: The ContainerBuilder whose service definitions can be altered.

Overrides ServiceProviderBase::alter

File

src/TwigExtenderServiceProvider.php, line 17

Class

TwigExtenderServiceProvider
Modifies the language manager service.

Namespace

Drupal\twig_extender

Code

public function alter(ContainerBuilder $container) {
  $definition = $container
    ->getDefinition('twig.extension');
  $definition
    ->setClass('\\Drupal\\twig_extender\\TwigExtenderService');
  $definition
    ->addArgument(new Reference('plugin.manager.twig_extender'));
}