You are here

public static function TwigTweakExtension::drupalBlock in Twig Tweak 3.x

Same name and namespace in other branches
  1. 3.1.x src/TwigTweakExtension.php \Drupal\twig_tweak\TwigTweakExtension::drupalBlock()

Builds the render array for a block.

File

src/TwigTweakExtension.php, line 144

Class

TwigTweakExtension
Twig extension with some useful functions and filters.

Namespace

Drupal\twig_tweak

Code

public static function drupalBlock(string $id, array $configuration = [], bool $wrapper = TRUE) : array {
  return \Drupal::service('twig_tweak.block_view_builder')
    ->build($id, $configuration, $wrapper);
}