You are here

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

Same name and namespace in other branches
  1. 2.0.x src/Plugin/Block/DashboardBlock.php \Drupal\dashboards\Plugin\Block\DashboardBlock::build()

Set if this block is in preview.

Overrides BlockPluginInterface::build

File

src/Plugin/Block/DashboardBlock.php, line 86

Class

DashboardBlock
Provides a dashboard block.

Namespace

Drupal\dashboards\Plugin\Block

Code

public function build() {
  return [
    '#type' => 'container',
    '#attached' => [
      'library' => [
        'dashboards/component',
      ],
    ],
    '#attributes' => [
      'class' => [
        'dashboard-component',
      ],
    ],
    'content' => $this->basePlugin
      ->buildRenderArray($this
      ->getConfiguration()),
  ];
}