public function MenuTrailByPathServiceProvider::alter in Menu Trail By Path 8
Modifies existing service definitions.
Parameters
ContainerBuilder $container: The ContainerBuilder whose service definitions can be altered.
Overrides ServiceProviderBase::alter
File
- src/
MenuTrailByPathServiceProvider.php, line 16
Class
- MenuTrailByPathServiceProvider
- Overrides the class for the menu link tree.
Namespace
Drupal\menu_trail_by_pathCode
public function alter(ContainerBuilder $container) {
$definition = $container
->getDefinition('menu.active_trail');
$definition
->setClass('Drupal\\menu_trail_by_path\\MenuTrailByPathActiveTrail');
$definition
->addArgument(new Reference('menu_trail_by_path.path_helper'));
$definition
->addArgument(new Reference('menu_trail_by_path.menu_helper'));
$definition
->addArgument(new Reference('router.request_context'));
$definition
->addArgument(new Reference('language_manager'));
$definition
->addArgument(new Reference('config.factory'));
}