function MenuLinkManager::rebuild
Same name in other branches
- 9 core/lib/Drupal/Core/Menu/MenuLinkManager.php \Drupal\Core\Menu\MenuLinkManager::rebuild()
- 10 core/lib/Drupal/Core/Menu/MenuLinkManager.php \Drupal\Core\Menu\MenuLinkManager::rebuild()
- 11.x core/lib/Drupal/Core/Menu/MenuLinkManager.php \Drupal\Core\Menu\MenuLinkManager::rebuild()
Overrides MenuLinkManagerInterface::rebuild
File
-
core/
lib/ Drupal/ Core/ Menu/ MenuLinkManager.php, line 188
Class
- MenuLinkManager
- Manages discovery, instantiation, and tree building of menu link plugins.
Namespace
Drupal\Core\MenuCode
public function rebuild() {
$definitions = $this->getDefinitions();
// Apply overrides from config.
$overrides = $this->overrides
->loadMultipleOverrides(array_keys($definitions));
foreach ($overrides as $id => $changes) {
if (!empty($definitions[$id])) {
$definitions[$id] = $changes + $definitions[$id];
}
}
$this->treeStorage
->rebuild($definitions);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.