You are here

public function MenuBlock::getBlockLabel in Menu Block 8

Gets the configured block label.

Return value

string The configured label.

1 call to MenuBlock::getBlockLabel()
MenuBlock::build in src/Plugin/Block/MenuBlock.php
Builds and returns the renderable array for this block plugin.

File

src/Plugin/Block/MenuBlock.php, line 396

Class

MenuBlock
Provides an extended Menu block.

Namespace

Drupal\menu_block\Plugin\Block

Code

public function getBlockLabel() {
  switch ($this->configuration['label_type']) {
    case self::LABEL_MENU:
      return $this
        ->getMenuTitle();
    case self::LABEL_ACTIVE_ITEM:
      return $this
        ->getActiveItemTitle();
    case self::LABEL_PARENT:
      return $this
        ->getActiveTrailParentTitle();
    case self::LABEL_ROOT:
      return $this
        ->getActiveTrailRootTitle();
    case self::LABEL_FIXED:
      return $this
        ->getFixedMenuItemTitle();
    default:
      return $this
        ->label();
  }
}