class ContextServiceProvider in Context 8
Same name and namespace in other branches
- 8.4 src/ContextServiceProvider.php \Drupal\context\ContextServiceProvider
Alter the service container to use a custom class.
Hierarchy
- class \Drupal\Core\DependencyInjection\ServiceProviderBase implements ServiceModifierInterface, ServiceProviderInterface
- class \Drupal\context\ContextServiceProvider
Expanded class hierarchy of ContextServiceProvider
File
- src/
ContextServiceProvider.php, line 11
Namespace
Drupal\contextView source
class ContextServiceProvider 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\\context\\ContextMenuActiveTrail');
$definition
->addArgument($container
->getDefinition('context.manager'));
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ContextServiceProvider:: |
public | function |
Modifies existing service definitions. Overrides ServiceProviderBase:: |
|
ServiceProviderBase:: |
public | function |
Registers services to the container. Overrides ServiceProviderInterface:: |
1 |