protected function CartBlock::renderTemplate in Commerce Cart Flyout 8
Renders a template.
Parameters
string $hook: The theme hook.
Return value
string The rendered template.
1 call to CartBlock::renderTemplate()
- CartBlock::build in src/
Plugin/ Block/ CartBlock.php - Builds and returns the renderable array for this block plugin.
File
- src/
Plugin/ Block/ CartBlock.php, line 143
Class
- CartBlock
- Provides a cart block.
Namespace
Drupal\commerce_cart_flyout\Plugin\BlockCode
protected function renderTemplate($hook) {
return $this->renderer
->executeInRenderContext(new RenderContext(), function () use ($hook) {
$build = [
'#theme' => $hook,
];
return $this->renderer
->render($build);
});
}