You are here

public function PageBlockDisplayVariant::build in Page Manager 8.4

Same name and namespace in other branches
  1. 8 src/Plugin/DisplayVariant/PageBlockDisplayVariant.php \Drupal\page_manager\Plugin\DisplayVariant\PageBlockDisplayVariant::build()

Builds and returns the renderable array for the display variant.

The variant can contain cacheability metadata for the configuration that was passed in setConfiguration(). In the build() method, this should be added to the render array that is returned.

Return value

array A render array for the display variant.

Overrides VariantInterface::build

File

src/Plugin/DisplayVariant/PageBlockDisplayVariant.php, line 101

Class

PageBlockDisplayVariant
Provides a variant plugin that simply contains blocks.

Namespace

Drupal\page_manager\Plugin\DisplayVariant

Code

public function build() {

  // Set default page cache keys that include the display.
  $build['#cache']['keys'] = [
    'page_manager_block_display',
    $this
      ->id(),
  ];
  $build['#pre_render'][] = [
    $this,
    'buildRegions',
  ];
  return $build;
}