function LocalTaskManager::getDefinitions

Same name in other branches
  1. 9 core/lib/Drupal/Core/Menu/LocalTaskManager.php \Drupal\Core\Menu\LocalTaskManager::getDefinitions()
  2. 10 core/lib/Drupal/Core/Menu/LocalTaskManager.php \Drupal\Core\Menu\LocalTaskManager::getDefinitions()
  3. 11.x core/lib/Drupal/Core/Menu/LocalTaskManager.php \Drupal\Core\Menu\LocalTaskManager::getDefinitions()

Overrides DefaultPluginManager::getDefinitions

1 call to LocalTaskManager::getDefinitions()
LocalTaskManager::getLocalTasksForRoute in core/lib/Drupal/Core/Menu/LocalTaskManager.php
Find all local tasks that appear on a named route.

File

core/lib/Drupal/Core/Menu/LocalTaskManager.php, line 200

Class

LocalTaskManager
Provides the default local task manager using YML as primary definition.

Namespace

Drupal\Core\Menu

Code

public function getDefinitions() {
    $definitions = parent::getDefinitions();
    $count = 0;
    foreach ($definitions as &$definition) {
        if (isset($definition['weight'])) {
            // Add some micro weight.
            $definition['weight'] += $count++ * 1.0E-6;
        }
    }
    return $definitions;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.