You are here

public static function BlockViewBuilder::lazyBuilder in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/block/src/BlockViewBuilder.php \Drupal\block\BlockViewBuilder::lazyBuilder()

#lazy_builder callback; builds a #pre_render-able block.

Parameters

$entity_id: A block config entity ID.

$view_mode: The view mode the block is being viewed in.

Return value

array A render array with a #pre_render callback to render the block.

File

core/modules/block/src/BlockViewBuilder.php, line 193
Contains \Drupal\block\BlockViewBuilder.

Class

BlockViewBuilder
Provides a Block view builder.

Namespace

Drupal\block

Code

public static function lazyBuilder($entity_id, $view_mode) {
  return static::buildPreRenderableBlock(entity_load('block', $entity_id), \Drupal::service('module_handler'));
}