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

Breadcrumb

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

function 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 157

Class

BlockViewBuilder
Provides a Block view builder.

Namespace

Drupal\block

Code

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

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal