You are here

public function MultiWidthLayoutBase::build in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/layout_builder/src/Plugin/Layout/MultiWidthLayoutBase.php \Drupal\layout_builder\Plugin\Layout\MultiWidthLayoutBase::build()

Build a render array for layout with regions.

Parameters

array $regions: An associative array keyed by region name, containing render arrays representing the content that should be placed in each region.

Return value

array Render array for the layout with regions.

Overrides LayoutDefault::build

File

core/modules/layout_builder/src/Plugin/Layout/MultiWidthLayoutBase.php, line 52

Class

MultiWidthLayoutBase
Base class of layouts with configurable widths.

Namespace

Drupal\layout_builder\Plugin\Layout

Code

public function build(array $regions) {
  $build = parent::build($regions);
  $build['#attributes']['class'] = [
    'layout',
    $this
      ->getPluginDefinition()
      ->getTemplate(),
    $this
      ->getPluginDefinition()
      ->getTemplate() . '--' . $this->configuration['column_widths'],
  ];
  return $build;
}