MenuActiveTrailsCacheContext::getCacheableMetadata

public MenuActiveTrailsCacheContext::getCacheableMetadata($menu_name = NULL) Gets the cacheability metadata for the context based on the parameter value. There are three valid cases for the returned CacheableMetadata object: An empty object means this can be optimized away safely. A max-age of 0 means that this context can never be optimized away. It will never bubble up and cache tags will not be used. Any non-zero max-age and cache tags will bubble up into the cache item if this is optimized

MenuActiveTrailsCacheContext

Defines the MenuActiveTrailsCacheContext service. This class is container-aware to avoid initializing the 'menu.active_trails' service (and its dependencies) when it is not necessary. Hierarchy class \Drupal\Core\Cache\Context\MenuActiveTrailsCacheContext implements CalculatedCacheContextInterface, ContainerAwareInterface uses ContainerAwareTrait File core/lib/Drupal/Core/Cache/Context/MenuActiveTrailsCacheContext.php, line 15 Namespace Drupal\Core\Cache\Context Members Name Modifie

MenuActiveTrailInterface::getActiveTrailIds

public MenuActiveTrailInterface::getActiveTrailIds($menu_name) Gets the active trail IDs of the specified menu tree. Parameters string|null $menu_name: (optional) The menu name of the requested tree. If omitted, all menu trees will be searched. Return value array An array containing the active trail: a list of plugin IDs. File core/lib/Drupal/Core/Menu/MenuActiveTrailInterface.php, line 23 Class MenuActiveTrailInterface Defines an interface for the active menu trail service. Namespace

MenuActiveTrailInterface::getActiveLink

public MenuActiveTrailInterface::getActiveLink($menu_name = NULL) Fetches a menu link which matches the route name, parameters and menu name. Parameters string|null $menu_name: (optional) The menu within which to find the active link. If omitted, all menus will be searched. Return value \Drupal\Core\Menu\MenuLinkInterface|null The menu link for the given route name, parameters and menu, or NULL if there is no matching menu link or the current user cannot access the current page (i.e. we have

MenuActiveTrailInterface

Defines an interface for the active menu trail service. The active trail of a given menu is the trail from the current page to the root of that menu's tree. Hierarchy interface \Drupal\Core\Menu\MenuActiveTrailInterface File core/lib/Drupal/Core/Menu/MenuActiveTrailInterface.php, line 11 Namespace Drupal\Core\Menu Members Name Modifiers Type Description MenuActiveTrailInterface::getActiveLink public function Fetches a menu link which matches the route name, parameters an

MenuActiveTrail::__construct

public MenuActiveTrail::__construct(MenuLinkManagerInterface $menu_link_manager, RouteMatchInterface $route_match, CacheBackendInterface $cache, LockBackendInterface $lock) Constructs a \Drupal\Core\Menu\MenuActiveTrail object. Parameters \Drupal\Core\Menu\MenuLinkManagerInterface $menu_link_manager: The menu link plugin manager. \Drupal\Core\Routing\RouteMatchInterface $route_match: A route match object for finding the active link. \Drupal\Core\Cache\CacheBackendInterface $cache: The cache ba

MenuActiveTrail::resolveCacheMiss

protected MenuActiveTrail::resolveCacheMiss($menu_name) Overrides CacheCollector::resolveCacheMiss See also ::getActiveTrailIds() File core/lib/Drupal/Core/Menu/MenuActiveTrail.php, line 70 Class MenuActiveTrail Provides the default implementation of the active menu trail service. Namespace Drupal\Core\Menu Code protected function resolveCacheMiss($menu_name) { $this->storage[$menu_name] = $this->doGetActiveTrailIds($menu_name); $this->tags[] = 'config:system.menu.' . $me

MenuActiveTrail::getCid

protected MenuActiveTrail::getCid() Overrides CacheCollector::getCid See also ::getActiveTrailIds() File core/lib/Drupal/Core/Menu/MenuActiveTrail.php, line 55 Class MenuActiveTrail Provides the default implementation of the active menu trail service. Namespace Drupal\Core\Menu Code protected function getCid() { if (!isset($this->cid)) { $route_parameters = $this->routeMatch->getRawParameters()->all(); ksort($route_parameters); return 'active-trail:route:' .

MenuActiveTrail::getActiveTrailIds

public MenuActiveTrail::getActiveTrailIds($menu_name) 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/MenuActive

MenuActiveTrail::getActiveLink

public MenuActiveTrail::getActiveLink($menu_name = NULL) Fetches a menu link which matches the route name, parameters and menu name. Parameters string|null $menu_name: (optional) The menu within which to find the active link. If omitted, all menus will be searched. Return value \Drupal\Core\Menu\MenuLinkInterface|null The menu link for the given route name, parameters and menu, or NULL if there is no matching menu link or the current user cannot access the current page (i.e. we have a 403 res