annotate core/lib/Drupal/Core/Menu/ContextualLinkInterface.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 a contextual link plugin.
Chris@0 7 *
Chris@0 8 * Contextual links by default are in the module_name.links.contextual.yml
Chris@0 9 * file. These YAML files contain a list of contextual link plugin definitions,
Chris@0 10 * keyed by the plugin ID. Each definition must define a route_name and a group
Chris@0 11 * and might define title, options, and weight. See the getter methods on this
Chris@0 12 * interface for an explanation of each.
Chris@0 13 *
Chris@0 14 * @ingroup menu
Chris@0 15 */
Chris@0 16 interface ContextualLinkInterface {
Chris@0 17
Chris@0 18 /**
Chris@0 19 * Returns the localized title to be shown for this contextual link.
Chris@0 20 *
Chris@0 21 * Subclasses may add optional arguments like NodeInterface $node = NULL that
Chris@0 22 * will be supplied by the ControllerResolver.
Chris@0 23 *
Chris@0 24 * @return string
Chris@0 25 * The title to be shown for this action.
Chris@0 26 *
Chris@0 27 * @see \Drupal\Core\Menu\ContextualLinksManager::getTitle()
Chris@0 28 */
Chris@0 29 public function getTitle();
Chris@0 30
Chris@0 31 /**
Chris@0 32 * Returns the route name of the contextual link.
Chris@0 33 *
Chris@0 34 * @return string
Chris@0 35 * The name of the route this contextual link links to.
Chris@0 36 */
Chris@0 37 public function getRouteName();
Chris@0 38
Chris@0 39 /**
Chris@0 40 * Returns the group this contextual link should be rendered in.
Chris@0 41 *
Chris@0 42 * A contextual link group is a set of contextual links that are displayed
Chris@0 43 * together on a certain page. For example, the 'block' group displays all
Chris@0 44 * links related to the block, such as the block instance edit link as well as
Chris@0 45 * the views edit link, if it is a view block.
Chris@0 46 *
Chris@0 47 * @return string
Chris@0 48 * The contextual links group name.
Chris@0 49 */
Chris@0 50 public function getGroup();
Chris@0 51
Chris@0 52 /**
Chris@0 53 * Returns the link options passed to the link generator.
Chris@0 54 *
Chris@0 55 * @return array
Chris@0 56 * An associative array of options.
Chris@0 57 */
Chris@0 58 public function getOptions();
Chris@0 59
Chris@0 60 /**
Chris@0 61 * Returns the weight of the contextual link.
Chris@0 62 *
Chris@0 63 * The contextual links in one group are sorted by weight for display.
Chris@0 64 *
Chris@0 65 * @return int
Chris@0 66 * The weight as positive/negative integer.
Chris@0 67 */
Chris@0 68 public function getWeight();
Chris@0 69
Chris@0 70 }