function LayoutBuilderTestPlugin::build

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

Overrides LayoutDefault::build

File

core/modules/layout_builder/tests/modules/layout_builder_test/src/Plugin/Layout/LayoutBuilderTestPlugin.php, line 28

Class

LayoutBuilderTestPlugin
The Layout Builder Test Plugin.

Namespace

Drupal\layout_builder_test\Plugin\Layout

Code

public function build(array $regions) {
    $build = parent::build($regions);
    $build['main']['#attributes']['class'][] = 'go-birds';
    if ($this->inPreview) {
        $build['main']['#attributes']['class'][] = 'go-birds-preview';
    }
    return $build;
}

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