8.5.x BlockPluginInterface.php BlockPluginInterface::build()
8.0.x BlockPluginInterface.php BlockPluginInterface::build()
8.1.x BlockPluginInterface.php BlockPluginInterface::build()
8.2.x BlockPluginInterface.php BlockPluginInterface::build()
8.3.x BlockPluginInterface.php BlockPluginInterface::build()
8.4.x BlockPluginInterface.php BlockPluginInterface::build()
8.6.x BlockPluginInterface.php 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

39 methods override BlockPluginInterface::build()
AggregatorFeedBlock::build in core/modules/aggregator/src/Plugin/Block/AggregatorFeedBlock.php
Builds and returns the renderable array for this block plugin.
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.
BlockContentBlock::build in core/modules/block_content/src/Plugin/Block/BlockContentBlock.php
Builds and returns the renderable array for this block plugin.
BookNavigationBlock::build in core/modules/book/src/Plugin/Block/BookNavigationBlock.php
Builds and returns the renderable array for this block plugin.

... See full list

File

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

Class

BlockPluginInterface
Defines the required interface for all block plugins.

Namespace

Drupal\Core\Block

Code

public function build();