You are here

protected function AddToCart::renderTemplate in Commerce Cart Flyout 8

Renders a template.

Parameters

string $hook: The theme hook.

Return value

string The rendered template.

1 call to AddToCart::renderTemplate()
AddToCart::viewElements in src/Plugin/Field/FieldFormatter/AddToCart.php
Builds a renderable array for a field value.

File

src/Plugin/Field/FieldFormatter/AddToCart.php, line 333

Class

AddToCart
Plugin implementation of the 'commerce_cart_flyout_add_to_cart' formatter.

Namespace

Drupal\commerce_cart_flyout\Plugin\Field\FieldFormatter

Code

protected function renderTemplate($hook) {
  $build = [
    '#theme' => $hook,
  ];
  return $this->renderer
    ->renderPlain($build);
}