function ShortcutServiceProvider::register

Same name and namespace in other branches
  1. 11.x core/modules/shortcut/src/ShortcutServiceProvider.php \Drupal\shortcut\ShortcutServiceProvider::register()

Registers services to the container.

Parameters

ContainerBuilder $container: The ContainerBuilder to register services to.

Overrides ServiceProviderInterface::register

File

core/modules/shortcut/src/ShortcutServiceProvider.php, line 21

Class

ShortcutServiceProvider
Defines a service provider for the Shortcut module.

Namespace

Drupal\shortcut

Code

public function register(ContainerBuilder $container) : void {
  // Register the navigation lazy builder if navigation module is enabled.
  if ($container->has('navigation.renderer')) {
    $container->register('navigation.shortcut_lazy_builder', ShortcutNavigationLazyBuilder::class)
      ->addArgument(new Reference('shortcut.lazy_builders'));
  }
}

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