annotate core/lib/Drupal/Core/Menu/MenuActiveTrailInterface.php @ 19:fa3358dc1485 tip

Add ndrum files
author Chris Cannam
date Wed, 28 Aug 2019 13:14:47 +0100
parents 4c8ae668cc8c
children
rev   line source
Chris@0 1 <?php
Chris@0 2
Chris@0 3 namespace Drupal\Core\Menu;
Chris@0 4
Chris@0 5 /**
Chris@0 6 * Defines an interface for the active menu trail service.
Chris@0 7 *
Chris@0 8 * The active trail of a given menu is the trail from the current page to the
Chris@0 9 * root of that menu's tree.
Chris@0 10 */
Chris@0 11 interface MenuActiveTrailInterface {
Chris@0 12
Chris@0 13 /**
Chris@0 14 * Gets the active trail IDs of the specified menu tree.
Chris@0 15 *
Chris@0 16 * @param string|null $menu_name
Chris@0 17 * (optional) The menu name of the requested tree. If omitted, all menu
Chris@0 18 * trees will be searched.
Chris@0 19 *
Chris@0 20 * @return array
Chris@0 21 * An array containing the active trail: a list of plugin IDs.
Chris@0 22 */
Chris@0 23 public function getActiveTrailIds($menu_name);
Chris@0 24
Chris@0 25 /**
Chris@0 26 * Fetches a menu link which matches the route name, parameters and menu name.
Chris@0 27 *
Chris@0 28 * @param string|null $menu_name
Chris@0 29 * (optional) The menu within which to find the active link. If omitted, all
Chris@0 30 * menus will be searched.
Chris@0 31 *
Chris@0 32 * @return \Drupal\Core\Menu\MenuLinkInterface|null
Chris@0 33 * The menu link for the given route name, parameters and menu, or NULL if
Chris@0 34 * there is no matching menu link or the current user cannot access the
Chris@0 35 * current page (i.e. we have a 403 response).
Chris@0 36 */
Chris@0 37 public function getActiveLink($menu_name = NULL);
Chris@0 38
Chris@0 39 }