You are here

public function LayoutPluginManager::getGroupedDefinitions in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Layout/LayoutPluginManager.php \Drupal\Core\Layout\LayoutPluginManager::getGroupedDefinitions()
  2. 9 core/lib/Drupal/Core/Layout/LayoutPluginManager.php \Drupal\Core\Layout\LayoutPluginManager::getGroupedDefinitions()

Return value

\Drupal\Core\Layout\LayoutDefinition[][]

Overrides LayoutPluginManagerInterface::getGroupedDefinitions

1 call to LayoutPluginManager::getGroupedDefinitions()
LayoutPluginManager::getLayoutOptions in core/lib/Drupal/Core/Layout/LayoutPluginManager.php
Returns an array of layout labels grouped by category.

File

core/lib/Drupal/Core/Layout/LayoutPluginManager.php, line 218

Class

LayoutPluginManager
Provides a plugin manager for layouts.

Namespace

Drupal\Core\Layout

Code

public function getGroupedDefinitions(array $definitions = NULL, $label_key = 'label') {
  $definitions = $this
    ->getSortedDefinitions($definitions ?? $this
    ->getDefinitions(), $label_key);
  $grouped_definitions = [];
  foreach ($definitions as $id => $definition) {
    $grouped_definitions[(string) $definition
      ->getCategory()][$id] = $definition;
  }
  return $grouped_definitions;
}