You are here

class MenuTokenServiceProvider in Menu Token 8

Same name and namespace in other branches
  1. 9.1.x src/MenuTokenServiceProvider.php \Drupal\menu_token\MenuTokenServiceProvider

Class MyModuleServiceProvider.

@package Drupal\mymodule

Hierarchy

Expanded class hierarchy of MenuTokenServiceProvider

File

src/MenuTokenServiceProvider.php, line 14

Namespace

Drupal\menu_token
View source
class MenuTokenServiceProvider extends ServiceProviderBase {

  /**
   * Override menu.link_tree service.
   *
   * @param \Drupal\Core\DependencyInjection\ContainerBuilder $container
   *   Dep container.
   */
  public function alter(ContainerBuilder $container) {
    $definition = $container
      ->getDefinition('menu.link_tree');
    $definition
      ->setClass('Drupal\\menu_token\\Service\\MenuLinkTreeMenuToken');
    $definition
      ->setArguments([
      new Reference('menu.tree_storage'),
      new Reference('plugin.manager.menu.link'),
      new Reference('router.route_provider'),
      new Reference('menu.active_trail'),
      new Reference('controller_resolver'),
    ]);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
MenuTokenServiceProvider::alter public function Override menu.link_tree service. Overrides ServiceProviderBase::alter
ServiceProviderBase::register public function Registers services to the container. Overrides ServiceProviderInterface::register 1