You are here

public function LayoutPluginManager::getLayoutOptions in Drupal 9

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

Returns an array of layout labels grouped by category.

Return value

string[][] A nested array of labels suitable for #options.

Overrides LayoutPluginManagerInterface::getLayoutOptions

File

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

Class

LayoutPluginManager
Provides a plugin manager for layouts.

Namespace

Drupal\Core\Layout

Code

public function getLayoutOptions() {
  $layout_options = [];
  foreach ($this
    ->getGroupedDefinitions() as $category => $layout_definitions) {
    foreach ($layout_definitions as $name => $layout_definition) {
      $layout_options[$category][$name] = $layout_definition
        ->getLabel();
    }
  }
  return $layout_options;
}