class MenuPositionServiceProvider in Menu Position 8
Menu Position service provider.
Hierarchy
- class \Drupal\Core\DependencyInjection\ServiceProviderBase implements ServiceModifierInterface, ServiceProviderInterface
- class \Drupal\menu_position\MenuPositionServiceProvider
Expanded class hierarchy of MenuPositionServiceProvider
File
- src/
MenuPositionServiceProvider.php, line 12
Namespace
Drupal\menu_positionView source
class MenuPositionServiceProvider extends ServiceProviderBase {
/**
* {@inheritdoc}
*/
public function alter(ContainerBuilder $container) {
// Override the menu active trail with a new class.
$definition = $container
->getDefinition('menu.active_trail');
$definition
->setClass('Drupal\\menu_position\\Menu\\MenuPositionActiveTrail');
$definition
->addArgument(new Reference('entity_type.manager'));
$definition
->addArgument(new Reference('config.factory'));
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
MenuPositionServiceProvider:: |
public | function |
Modifies existing service definitions. Overrides ServiceProviderBase:: |
|
ServiceProviderBase:: |
public | function |
Registers services to the container. Overrides ServiceProviderInterface:: |
1 |