LocalTaskManager::getDefinitions

public LocalTaskManager::getDefinitions()

Gets the definition of all plugins for this type.

Return value

mixed[] An array of plugin definitions (empty array if no definitions were found). Keys are plugin IDs.

Overrides DefaultPluginManager::getDefinitions

File

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

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++) * 1e-6;
    }
  }

  return $definitions;
}
doc_Drupal
2016-10-29 09:24:50
Comments
Leave a Comment

Please login to continue.