function BlockPluginInterface::build
Same name in other branches
- 9 core/lib/Drupal/Core/Block/BlockPluginInterface.php \Drupal\Core\Block\BlockPluginInterface::build()
- 8.9.x core/lib/Drupal/Core/Block/BlockPluginInterface.php \Drupal\Core\Block\BlockPluginInterface::build()
- 10 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
54 methods override BlockPluginInterface::build()
- AjaxFormBlock::build in core/
modules/ system/ tests/ modules/ ajax_forms_test/ src/ Plugin/ Block/ AjaxFormBlock.php - AnnounceBlock::build in core/
modules/ announcements_feed/ src/ Plugin/ Block/ AnnounceBlock.php - AttachedRenderingBlock::build in core/
modules/ system/ tests/ modules/ render_attached_test/ src/ Plugin/ Block/ AttachedRenderingBlock.php - BlockContentBlock::build in core/
modules/ block_content/ src/ Plugin/ Block/ BlockContentBlock.php - BookNavigationBlock::build in core/
modules/ book/ src/ Plugin/ Block/ BookNavigationBlock.php - Builds and returns the renderable array for this block plugin.
File
-
core/
lib/ Drupal/ Core/ Block/ BlockPluginInterface.php, line 77
Class
- BlockPluginInterface
- Defines the required interface for all block plugins.
Namespace
Drupal\Core\BlockCode
public function build();
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.