You are here

private function CartButtonBlock::getIconTag in Commerce Cart Blocks 8

Gets the HTML tag used for the icon as markup.

1 call to CartButtonBlock::getIconTag()
CartButtonBlock::buildIcon in src/Plugin/Block/CartButtonBlock.php
Builds the icon output.

File

src/Plugin/Block/CartButtonBlock.php, line 142

Class

CartButtonBlock
Provides a cart block.

Namespace

Drupal\commerce_cart_blocks\Plugin\Block

Code

private function getIconTag() {
  $iconType = $this->configuration['icon_type'];
  return [
    '#type' => 'markup',
    '#markup' => $iconType === 'class' ? '<i class="' . $this->configuration['icon_class'] . '"></i>' : '',
  ];
}