You are here

function block_token_block_render in Block Token 8

Same name and namespace in other branches
  1. 7 block_token.module \block_token_block_render()

Renders the block.

Parameters

string $bid: Block Id.

Return value

string Rendered block.

1 call to block_token_block_render()
block_token_tokens in ./block_token.module
Implements hook_tokens().

File

./block_token.module, line 56
Defines necessary hooks and functions for block_token form.

Code

function block_token_block_render($bid) {
  $block = Block::load($bid);
  $block_content = \Drupal::entityTypeManager()
    ->getViewBuilder('block')
    ->view($block);
  return \Drupal::service('renderer')
    ->render($block_content);
}