You are here

protected function MenuBlock::getActiveTrailRootTitle in Menu Block 8

Gets the current menu item's root menu item title.

Return value

string|null The root menu item title or NULL if there's no active item.

1 call to MenuBlock::getActiveTrailRootTitle()
MenuBlock::getBlockLabel in src/Plugin/Block/MenuBlock.php
Gets the configured block label.

File

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

Class

MenuBlock
Provides an extended Menu block.

Namespace

Drupal\menu_block\Plugin\Block

Code

protected function getActiveTrailRootTitle() {

  /** @var array $active_trail_ids */
  $active_trail_ids = $this
    ->getDerivativeActiveTrailIds();
  if ($active_trail_ids) {
    return $this
      ->getLinkTitleFromLink(end($active_trail_ids));
  }
}