BlockManager::getSortedDefinitions

public BlockManager::getSortedDefinitions(array $definitions = NULL)

Gets sorted plugin definitions.

Parameters

array[]|null $definitions: (optional) The plugin definitions to sort. If omitted, all plugin definitions are used.

Return value

array[] An array of plugin definitions, sorted by category and label.

Overrides CategorizingPluginManagerInterface::getSortedDefinitions

File

core/lib/Drupal/Core/Block/BlockManager.php, line 56

Class

BlockManager
Manages discovery and instantiation of block plugins.

Namespace

Drupal\Core\Block

Code

public function getSortedDefinitions(array $definitions = NULL) {
  // Sort the plugins first by category, then by label.
  $definitions = $this->traitGetSortedDefinitions($definitions, 'admin_label');
  // Do not display the 'broken' plugin in the UI.
  unset($definitions['broken']);
  return $definitions;
}
doc_Drupal
2016-10-29 08:47:45
Comments
Leave a Comment

Please login to continue.