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

Breadcrumb

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

function BlockPluginInterface::build

Builds and returns the renderable array for this block plugin.

If a block should not be rendered because it has no content, then this method must also ensure to return no content: it must then only return an empty array, or an empty array with #cache set (with cacheability metadata indicating the circumstances for it being empty).

Return value

array A renderable array representing the content of the block.

See also

\Drupal\block\BlockViewBuilder

27 methods override BlockPluginInterface::build()
AnnounceBlock::build in core/modules/announcements_feed/src/Plugin/Block/AnnounceBlock.php
Builds and returns the renderable array for this block plugin.
BlockContentBlock::build in core/modules/block_content/src/Plugin/Block/BlockContentBlock.php
Builds and returns the renderable array for this block plugin.
Broken::build in core/lib/Drupal/Core/Block/Plugin/Block/Broken.php
Builds and returns the renderable array for this block plugin.
ExtraFieldBlock::build in core/modules/layout_builder/src/Plugin/Block/ExtraFieldBlock.php
Builds and returns the renderable array for this block plugin.
FieldBlock::build in core/modules/layout_builder/src/Plugin/Block/FieldBlock.php
Builds and returns the renderable array for this block plugin.

... See full list

File

core/lib/Drupal/Core/Block/BlockPluginInterface.php, line 77

Class

BlockPluginInterface
Defines the required interface for all block plugins.

Namespace

Drupal\Core\Block

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