You are here

public function MenuTokenContextManager::replaceContextualLinks in Menu Token 8

Same name and namespace in other branches
  1. 9.1.x src/Service/MenuTokenContextManager.php \Drupal\menu_token\Service\MenuTokenContextManager::replaceContextualLinks()

Replace contextual links.

File

src/Service/MenuTokenContextManager.php, line 109

Class

MenuTokenContextManager
Menu token context manager service.

Namespace

Drupal\menu_token\Service

Code

public function replaceContextualLinks() {
  $contextual_replacement_links = unserialize($this->state
    ->get('menu_token_links_contextual_replacements'));
  if (empty($contextual_replacement_links)) {
    return TRUE;
  }
  $this->menuTokenMenuLinkManager
    ->rebuildMenuToken($contextual_replacement_links);
}