You are here

public function BlockPluginInterface::build in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Block/BlockPluginInterface.php \Drupal\Core\Block\BlockPluginInterface::build()
  2. 9 core/lib/Drupal/Core/Block/BlockPluginInterface.php \Drupal\Core\Block\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

24 methods override BlockPluginInterface::build()
AjaxFormBlock::build in core/modules/system/tests/modules/ajax_forms_test/src/Plugin/Block/AjaxFormBlock.php
Builds and returns the renderable array for this block plugin.
AttachedRenderingBlock::build in core/modules/system/tests/modules/render_attached_test/src/Plugin/Block/AttachedRenderingBlock.php
Builds and returns the renderable array for this block plugin.
IHaveRuntimeContexts::build in core/modules/layout_builder/tests/modules/layout_builder_test/src/Plugin/Block/IHaveRuntimeContexts.php
Builds and returns the renderable array for this block plugin.
NodeContextTestBlock::build in core/modules/node/tests/modules/node_block_test/src/Plugin/Block/NodeContextTestBlock.php
Builds and returns the renderable array for this block plugin.
PreviewAwareBlock::build in core/modules/layout_builder/tests/modules/layout_builder_test/src/Plugin/Block/PreviewAwareBlock.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();