class MenuLinkWeightServiceProvider in Menu Link Weight 8
Same name and namespace in other branches
- 8.2 src/MenuLinkWeightServiceProvider.php \Drupal\menu_link_weight\MenuLinkWeightServiceProvider
Overrides the menu.parent_form_selector service.
Hierarchy
- class \Drupal\Core\DependencyInjection\ServiceProviderBase implements ServiceModifierInterface, ServiceProviderInterface
- class \Drupal\menu_link_weight\MenuLinkWeightServiceProvider
Expanded class hierarchy of MenuLinkWeightServiceProvider
File
- src/
MenuLinkWeightServiceProvider.php, line 13
Namespace
Drupal\menu_link_weightView source
class MenuLinkWeightServiceProvider extends ServiceProviderBase {
/**
* @inheritDoc
*/
public function alter(ContainerBuilder $container) {
$settings = BootstrapConfigStorageFactory::get()
->read('menu_link_weight.settings');
$modules = $container
->getParameter('container.modules');
if (isset($settings['menu_parent_form_selector']) && $settings['menu_parent_form_selector'] === 'cshs' && isset($modules['cshs'])) {
$defintion = $container
->getDefinition('menu.parent_form_selector');
$defintion
->setClass(CshsMenuParentFormSelector::class);
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
MenuLinkWeightServiceProvider:: |
public | function |
@inheritDoc Overrides ServiceProviderBase:: |
|
ServiceProviderBase:: |
public | function |
Registers services to the container. Overrides ServiceProviderInterface:: |
1 |