Last active
May 29, 2018 00:31
-
-
Save DuaelFr/485feccad6d8d759c35f to your computer and use it in GitHub Desktop.
Drupal 8 : all menu items always visible
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// File name : my_module/src/MyModuleServiceProvider.php | |
/** | |
* @file | |
* Contains \Drupal\my_module\MyModuleServiceProvider. | |
*/ | |
namespace Drupal\my_module; | |
use Drupal\Core\DependencyInjection\ContainerBuilder; | |
use Drupal\Core\DependencyInjection\ServiceProviderBase; | |
/** | |
* Class MyModuleServiceProvider. | |
*/ | |
class MyModuleServiceProvider extends ServiceProviderBase { | |
/** | |
* {@inheritdoc} | |
*/ | |
public function alter(ContainerBuilder $container) { | |
$definition = $container->getDefinition('menu.link_tree'); | |
$definition->setClass('Drupal\my_module\Menu\MenuLinkTree'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment