3 namespace Drupal\Core\Menu;
6 * Defines a contextual link plugin.
8 * Contextual links by default are in the module_name.links.contextual.yml
9 * file. These YAML files contain a list of contextual link plugin definitions,
10 * keyed by the plugin ID. Each definition must define a route_name and a group
11 * and might define title, options, and weight. See the getter methods on this
12 * interface for an explanation of each.
16 interface ContextualLinkInterface {
19 * Returns the localized title to be shown for this contextual link.
21 * Subclasses may add optional arguments like NodeInterface $node = NULL that
22 * will be supplied by the ControllerResolver.
25 * The title to be shown for this action.
27 * @see \Drupal\Core\Menu\ContextualLinksManager::getTitle()
29 public function getTitle();
32 * Returns the route name of the contextual link.
35 * The name of the route this contextual link links to.
37 public function getRouteName();
40 * Returns the group this contextual link should be rendered in.
42 * A contextual link group is a set of contextual links that are displayed
43 * together on a certain page. For example, the 'block' group displays all
44 * links related to the block, such as the block instance edit link as well as
45 * the views edit link, if it is a view block.
48 * The contextual links group name.
50 public function getGroup();
53 * Returns the link options passed to the link generator.
56 * An associative array of options.
58 public function getOptions();
61 * Returns the weight of the contextual link.
63 * The contextual links in one group are sorted by weight for display.
66 * The weight as positive/negative integer.
68 public function getWeight();