function ViewsMenuLink::getTitle

Returns the localized title to be shown for this link.

Return value

string The title of the menu link.

Overrides MenuLinkInterface::getTitle

File

core/modules/views/src/Plugin/Menu/ViewsMenuLink.php, line 109

Class

ViewsMenuLink
Defines menu links provided by views.

Namespace

Drupal\views\Plugin\Menu

Code

public function getTitle() {
  // @todo Get the translated value from the config without instantiating the
  //   view. https://www.drupal.org/node/2310379
  return $this->loadView()->display_handler
    ->getOption('menu')['title'];
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.