function MultiWidthLayoutBase::build

Same name in other branches
  1. 9 core/modules/layout_builder/src/Plugin/Layout/MultiWidthLayoutBase.php \Drupal\layout_builder\Plugin\Layout\MultiWidthLayoutBase::build()
  2. 10 core/modules/layout_builder/src/Plugin/Layout/MultiWidthLayoutBase.php \Drupal\layout_builder\Plugin\Layout\MultiWidthLayoutBase::build()
  3. 11.x core/modules/layout_builder/src/Plugin/Layout/MultiWidthLayoutBase.php \Drupal\layout_builder\Plugin\Layout\MultiWidthLayoutBase::build()

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;
}

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