3 namespace Drupal\Core\Menu;
5 use Drupal\Core\Routing\RouteMatchInterface;
8 * Defines an interface for menu local actions.
10 interface LocalActionInterface {
13 * Get the route name from the settings.
16 * The name of the route this action links to.
18 public function getRouteName();
21 * Returns the route parameters needed to render a link for the local action.
23 * @param \Drupal\Core\Routing\RouteMatchInterface $route_match
24 * The current route match.
27 * An array of parameter names and values.
29 public function getRouteParameters(RouteMatchInterface $route_match);
32 * Returns the weight for the local action.
36 public function getWeight();
39 * Returns options for rendering a link for the local action.
41 * @param \Drupal\Core\Routing\RouteMatchInterface $route_match
42 * The current route match.
45 * An associative array of options.
47 public function getOptions(RouteMatchInterface $route_match);
50 * Returns the localized title to be shown for this action.
52 * Subclasses may add optional arguments like NodeInterface $node = NULL that
53 * will be supplied by the ControllerResolver.
56 * The title to be shown for this action.
58 * @see \Drupal\Core\Menu\LocalActionManager::getTitle()
60 public function getTitle();