W3cubDocs

/Drupal 8

public function MenuRouterRebuildSubscriber::onRouterRebuild

public MenuRouterRebuildSubscriber::onRouterRebuild(Event $event)

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 48

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(array('local_task'));
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!EventSubscriber!MenuRouterRebuildSubscriber.php/function/MenuRouterRebuildSubscriber::onRouterRebuild/8.1.x