public function Render::renderBlock in Bamboo Twig 8.4
Same name and namespace in other branches
- 8.5 bamboo_twig_loader/src/TwigExtension/Render.php \Drupal\bamboo_twig_loader\TwigExtension\Render::renderBlock()
- 8.2 bamboo_twig_loader/src/TwigExtension/Render.php \Drupal\bamboo_twig_loader\TwigExtension\Render::renderBlock()
- 8.3 bamboo_twig_loader/src/TwigExtension/Render.php \Drupal\bamboo_twig_loader\TwigExtension\Render::renderBlock()
Load a given block with or whitout parameters.
Parameters
string $block_id: The ID of the block to render.
array $params: (optional) An array of parameters passed to the block.
Return value
null|array A render array for the block or NULL if the block does not exist.
File
- bamboo_twig_loader/
src/ TwigExtension/ Render.php, line 49
Class
- Render
- Provides some renderer as Twig Extensions.
Namespace
Drupal\bamboo_twig_loader\TwigExtensionCode
public function renderBlock($block_id, array $params = []) {
$instance = $this
->getPluginManagerBlock()
->createInstance($block_id, $params);
return $instance
->build($params);
}