function MenuActiveTrail::getActiveTrailIds

Same name in this branch
  1. 11.x core/lib/Drupal/Core/ProxyClass/Menu/MenuActiveTrail.php \Drupal\Core\ProxyClass\Menu\MenuActiveTrail::getActiveTrailIds()
Same name in other branches
  1. 9 core/lib/Drupal/Core/Menu/MenuActiveTrail.php \Drupal\Core\Menu\MenuActiveTrail::getActiveTrailIds()
  2. 8.9.x core/lib/Drupal/Core/Menu/MenuActiveTrail.php \Drupal\Core\Menu\MenuActiveTrail::getActiveTrailIds()
  3. 10 core/lib/Drupal/Core/ProxyClass/Menu/MenuActiveTrail.php \Drupal\Core\ProxyClass\Menu\MenuActiveTrail::getActiveTrailIds()
  4. 10 core/lib/Drupal/Core/Menu/MenuActiveTrail.php \Drupal\Core\Menu\MenuActiveTrail::getActiveTrailIds()

This implementation caches all active trail IDs per route match for *all* menus whose active trails are calculated on that page. This ensures 1 cache get for all active trails per page load, rather than N.

It uses the cache collector pattern to do this.

Overrides MenuActiveTrailInterface::getActiveTrailIds

See also

::get()

\Drupal\Core\Cache\CacheCollectorInterface

\Drupal\Core\Cache\CacheCollector

File

core/lib/Drupal/Core/Menu/MenuActiveTrail.php, line 91

Class

MenuActiveTrail
Provides the default implementation of the active menu trail service.

Namespace

Drupal\Core\Menu

Code

public function getActiveTrailIds($menu_name) {
    return $this->get($menu_name);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.