Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. VariantInterface.php

function 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.

2 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.

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();

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal