You are here

public function GridLayoutDiscovery::getLayoutOptions in Paragraphs Collection 8

Gets sorted grid layout titles keyed by their machine names.

Return value

array Array of availalable layout options in key value pairs, where the key is the machine name and the value the description.

Overrides GridLayoutDiscoveryInterface::getLayoutOptions

File

src/GridLayoutDiscovery.php, line 116

Class

GridLayoutDiscovery
Provides common helper methods for style discovery.

Namespace

Drupal\paragraphs_collection

Code

public function getLayoutOptions() {
  $layout_options = [];
  $layouts = $this
    ->getGridLayouts();
  foreach ($layouts as $name => $layout) {
    $layout_options[$name] = $layout['title'];
  }
  uasort($layout_options, 'strcasecmp');
  return $layout_options;
}