Mercurial > hg > isophonics-drupal-site
comparison core/lib/Drupal/Core/Menu/LocalTaskInterface.php @ 0:4c8ae668cc8c
Initial import (non-working)
author | Chris Cannam |
---|---|
date | Wed, 29 Nov 2017 16:09:58 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:4c8ae668cc8c |
---|---|
1 <?php | |
2 | |
3 namespace Drupal\Core\Menu; | |
4 | |
5 use Drupal\Core\Routing\RouteMatchInterface; | |
6 | |
7 /** | |
8 * Defines an interface for menu local tasks. | |
9 * | |
10 * Menu local tasks are typically rendered as navigation tabs above the content | |
11 * region, though other presentations are possible. It is convention that the | |
12 * titles of these tasks should be short verbs if possible. | |
13 * | |
14 * @see \Drupal\Core\Menu\LocalTaskManagerInterface | |
15 */ | |
16 interface LocalTaskInterface { | |
17 | |
18 /** | |
19 * Get the route name from the settings. | |
20 * | |
21 * @return string | |
22 * The name of the route this local task links to. | |
23 */ | |
24 public function getRouteName(); | |
25 | |
26 /** | |
27 * Returns the localized title to be shown for this tab. | |
28 * | |
29 * Subclasses may add optional arguments like NodeInterface $node = NULL that | |
30 * will be supplied by the ControllerResolver. | |
31 * | |
32 * @return string | |
33 * The title of the local task. | |
34 */ | |
35 public function getTitle(); | |
36 | |
37 /** | |
38 * Returns the route parameters needed to render a link for the local task. | |
39 * | |
40 * @param \Drupal\Core\Routing\RouteMatchInterface $route_match | |
41 * The current route match. | |
42 * | |
43 * @return array | |
44 * An array of parameter names and values. | |
45 */ | |
46 public function getRouteParameters(RouteMatchInterface $route_match); | |
47 | |
48 /** | |
49 * Returns the weight of the local task. | |
50 * | |
51 * @return int|null | |
52 * The weight of the task or NULL. | |
53 */ | |
54 public function getWeight(); | |
55 | |
56 /** | |
57 * Returns options for rendering a link to the local task. | |
58 * | |
59 * @param \Drupal\Core\Routing\RouteMatchInterface $route_match | |
60 * The current route match. | |
61 * | |
62 * @return array | |
63 * An associative array of options. | |
64 */ | |
65 public function getOptions(RouteMatchInterface $route_match); | |
66 | |
67 /** | |
68 * Sets the active status. | |
69 * | |
70 * @param bool $active | |
71 * Sets whether this tab is active (e.g. a parent of the current tab). | |
72 * | |
73 * @return \Drupal\Core\Menu\LocalTaskInterface | |
74 * The called object for chaining. | |
75 */ | |
76 public function setActive($active = TRUE); | |
77 | |
78 /** | |
79 * Gets the active status. | |
80 * | |
81 * @return bool | |
82 * TRUE if the local task is active, FALSE otherwise. | |
83 * | |
84 * @see \Drupal\system\Plugin\MenuLocalTaskInterface::setActive() | |
85 */ | |
86 public function getActive(); | |
87 | |
88 } |