function MenuActiveTrailInterface::getActiveLink

Same name in other branches
  1. 9 core/lib/Drupal/Core/Menu/MenuActiveTrailInterface.php \Drupal\Core\Menu\MenuActiveTrailInterface::getActiveLink()
  2. 8.9.x core/lib/Drupal/Core/Menu/MenuActiveTrailInterface.php \Drupal\Core\Menu\MenuActiveTrailInterface::getActiveLink()
  3. 11.x core/lib/Drupal/Core/Menu/MenuActiveTrailInterface.php \Drupal\Core\Menu\MenuActiveTrailInterface::getActiveLink()

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 response).

File

core/lib/Drupal/Core/Menu/MenuActiveTrailInterface.php, line 37

Class

MenuActiveTrailInterface
Defines an interface for the active menu trail service.

Namespace

Drupal\Core\Menu

Code

public function getActiveLink($menu_name = NULL);

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