3 namespace Drupal\Core\Menu;
6 * Provides an object which returns the available contextual links.
8 interface ContextualLinkManagerInterface {
11 * Gets the contextual link plugins by contextual link group.
13 * @param string $group_name
17 * A list of contextual links plugin definitions.
19 public function getContextualLinkPluginsByGroup($group_name);
22 * Gets the contextual links prepared as expected by links.html.twig.
24 * @param string $group_name
26 * @param array $route_parameters
27 * The incoming route parameters. The route parameters need to have the same
28 * name on all contextual link routes, e.g. you cannot use 'node' and
29 * 'entity' in parallel.
30 * @param array $metadata
31 * Additional metadata of contextual links, like the position (optional).
34 * An array of link information, keyed by the plugin ID. Each entry is an
35 * associative array with the following keys:
36 * - route_name: The route name to link to.
37 * - route_parameters: The route parameters for the contextual link.
38 * - title: The title of the contextual link.
39 * - weight: The weight of the contextual link.
40 * - localized_options: The options of the link, which will be passed
41 * to the link generator.
42 * - metadata: The array of additional metadata that was passed in.
44 public function getContextualLinksArrayByGroup($group_name, array $route_parameters, array $metadata = []);