function LayoutPluginManager::getGroupedDefinitions

Same name in other branches
  1. 9 core/lib/Drupal/Core/Layout/LayoutPluginManager.php \Drupal\Core\Layout\LayoutPluginManager::getGroupedDefinitions()
  2. 10 core/lib/Drupal/Core/Layout/LayoutPluginManager.php \Drupal\Core\Layout\LayoutPluginManager::getGroupedDefinitions()
  3. 11.x 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(isset($definitions) ? $definitions : $this->getDefinitions(), $label_key);
    $grouped_definitions = [];
    foreach ($definitions as $id => $definition) {
        $grouped_definitions[(string) $definition->getCategory()][$id] = $definition;
    }
    return $grouped_definitions;
}

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