You are here

public function SectionLayout::build in Dashboards with Layout Builder 8

Same name and namespace in other branches
  1. 2.0.x src/Layouts/SectionLayout.php \Drupal\dashboards\Layouts\SectionLayout::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

src/Layouts/SectionLayout.php, line 48

Class

SectionLayout
Add layout settings.

Namespace

Drupal\dashboards\Layouts

Code

public function build(array $regions) {
  $configuration = $this
    ->getConfiguration();
  $build = parent::build($regions);
  if ($configuration['reverse']) {
    $build['#attributes']['class'][] = 'dashboard-reverse';
  }
  return $build;
}