3 namespace Drupal\Core\Menu;
6 * Defines an interface for the active menu trail service.
8 * The active trail of a given menu is the trail from the current page to the
9 * root of that menu's tree.
11 interface MenuActiveTrailInterface {
14 * Gets the active trail IDs of the specified menu tree.
16 * @param string|null $menu_name
17 * (optional) The menu name of the requested tree. If omitted, all menu
18 * trees will be searched.
21 * An array containing the active trail: a list of plugin IDs.
23 public function getActiveTrailIds($menu_name);
26 * Fetches a menu link which matches the route name, parameters and menu name.
28 * @param string|null $menu_name
29 * (optional) The menu within which to find the active link. If omitted, all
30 * menus will be searched.
32 * @return \Drupal\Core\Menu\MenuLinkInterface|null
33 * The menu link for the given route name, parameters and menu, or NULL if
34 * there is no matching menu link or the current user cannot access the
35 * current page (i.e. we have a 403 response).
37 public function getActiveLink($menu_name = NULL);