class MenuTokenServiceProvider in Menu Token 8
Same name and namespace in other branches
- 9.1.x src/MenuTokenServiceProvider.php \Drupal\menu_token\MenuTokenServiceProvider
Class MyModuleServiceProvider.
@package Drupal\mymodule
Hierarchy
- class \Drupal\Core\DependencyInjection\ServiceProviderBase implements ServiceModifierInterface, ServiceProviderInterface
- class \Drupal\menu_token\MenuTokenServiceProvider
Expanded class hierarchy of MenuTokenServiceProvider
File
- src/
MenuTokenServiceProvider.php, line 14
Namespace
Drupal\menu_tokenView 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
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
MenuTokenServiceProvider:: |
public | function |
Override menu.link_tree service. Overrides ServiceProviderBase:: |
|
ServiceProviderBase:: |
public | function |
Registers services to the container. Overrides ServiceProviderInterface:: |
1 |