annotate core/lib/Drupal/Core/Menu/ContextualLinkManagerInterface.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 * Provides an object which returns the available contextual links.
Chris@0 7 */
Chris@0 8 interface ContextualLinkManagerInterface {
Chris@0 9
Chris@0 10 /**
Chris@0 11 * Gets the contextual link plugins by contextual link group.
Chris@0 12 *
Chris@0 13 * @param string $group_name
Chris@0 14 * The group name.
Chris@0 15 *
Chris@0 16 * @return array
Chris@0 17 * A list of contextual links plugin definitions.
Chris@0 18 */
Chris@0 19 public function getContextualLinkPluginsByGroup($group_name);
Chris@0 20
Chris@0 21 /**
Chris@0 22 * Gets the contextual links prepared as expected by links.html.twig.
Chris@0 23 *
Chris@0 24 * @param string $group_name
Chris@0 25 * The group name.
Chris@0 26 * @param array $route_parameters
Chris@0 27 * The incoming route parameters. The route parameters need to have the same
Chris@0 28 * name on all contextual link routes, e.g. you cannot use 'node' and
Chris@0 29 * 'entity' in parallel.
Chris@0 30 * @param array $metadata
Chris@0 31 * Additional metadata of contextual links, like the position (optional).
Chris@0 32 *
Chris@0 33 * @return array
Chris@0 34 * An array of link information, keyed by the plugin ID. Each entry is an
Chris@0 35 * associative array with the following keys:
Chris@0 36 * - route_name: The route name to link to.
Chris@0 37 * - route_parameters: The route parameters for the contextual link.
Chris@0 38 * - title: The title of the contextual link.
Chris@0 39 * - weight: The weight of the contextual link.
Chris@0 40 * - localized_options: The options of the link, which will be passed
Chris@0 41 * to the link generator.
Chris@0 42 * - metadata: The array of additional metadata that was passed in.
Chris@0 43 */
Chris@0 44 public function getContextualLinksArrayByGroup($group_name, array $route_parameters, array $metadata = []);
Chris@0 45
Chris@0 46 }