function VariantInterface::build

Same name in other branches
  1. 9 core/lib/Drupal/Core/Display/VariantInterface.php \Drupal\Core\Display\VariantInterface::build()
  2. 8.9.x core/lib/Drupal/Core/Display/VariantInterface.php \Drupal\Core\Display\VariantInterface::build()
  3. 10 core/lib/Drupal/Core/Display/VariantInterface.php \Drupal\Core\Display\VariantInterface::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.

3 methods override VariantInterface::build()
BlockPageVariant::build in core/modules/block/src/Plugin/DisplayVariant/BlockPageVariant.php
Builds and returns the renderable array for the display variant.
SimplePageVariant::build in core/lib/Drupal/Core/Render/Plugin/DisplayVariant/SimplePageVariant.php
Builds and returns the renderable array for the display variant.
TestDisplayVariant::build in core/modules/system/tests/modules/display_variant_test/src/Plugin/DisplayVariant/TestDisplayVariant.php
Builds and returns the renderable array for the display variant.

File

core/lib/Drupal/Core/Display/VariantInterface.php, line 86

Class

VariantInterface
Provides an interface for DisplayVariant plugins.

Namespace

Drupal\Core\Display

Code

public function build();

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