public function LocalTaskDefault::getWeight
public LocalTaskDefault::getWeight()
Returns the weight of the local task.
Return value
int The weight of the task. If not defined in the annotation returns 0 by default or -10 for the root tab.
Overrides LocalTaskInterface::getWeight
File
- core/lib/Drupal/Core/Menu/LocalTaskDefault.php, line 89
Class
- LocalTaskDefault
- Default object used for LocalTaskPlugins.
Namespace
Drupal\Core\MenuCode
public function getWeight() { // By default the weight is 0, or -10 for the root tab. if (!isset($this->pluginDefinition['weight'])) { if ($this->pluginDefinition['base_route'] == $this->pluginDefinition['route_name']) { $this->pluginDefinition['weight'] = -10; } else { $this->pluginDefinition['weight'] = 0; } } return (int) $this->pluginDefinition['weight']; }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Menu!LocalTaskDefault.php/function/LocalTaskDefault::getWeight/8.1.x