You are here

public function MenuRouterRebuildSubscriber::onRouterRebuild in Drupal 8

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/EventSubscriber/MenuRouterRebuildSubscriber.php \Drupal\Core\EventSubscriber\MenuRouterRebuildSubscriber::onRouterRebuild()
  2. 10 core/lib/Drupal/Core/EventSubscriber/MenuRouterRebuildSubscriber.php \Drupal\Core\EventSubscriber\MenuRouterRebuildSubscriber::onRouterRebuild()

Rebuilds the menu links and deletes the local_task cache tag.

Parameters

\Symfony\Component\EventDispatcher\Event $event: The event object.

File

core/lib/Drupal/Core/EventSubscriber/MenuRouterRebuildSubscriber.php, line 70

Class

MenuRouterRebuildSubscriber
Rebuilds the default menu links and runs menu-specific code if necessary.

Namespace

Drupal\Core\EventSubscriber

Code

public function onRouterRebuild(Event $event) {
  $this
    ->menuLinksRebuild();
  Cache::invalidateTags([
    'local_task',
  ]);
}