You are here

public function MenuLinkEntity::getTitle in Admin Toolbar 3.x

Same name and namespace in other branches
  1. 8.2 admin_toolbar_tools/src/Plugin/Menu/MenuLinkEntity.php \Drupal\admin_toolbar_tools\Plugin\Menu\MenuLinkEntity::getTitle()

Returns the localized title to be shown for this link.

Return value

string The title of the menu link.

Overrides MenuLinkDefault::getTitle

File

admin_toolbar_tools/src/Plugin/Menu/MenuLinkEntity.php, line 59

Class

MenuLinkEntity
Provides a menu link plugins for configuration entities.

Namespace

Drupal\admin_toolbar_tools\Plugin\Menu

Code

public function getTitle() {
  if ($this->entity) {
    return (string) $this->entity
      ->label();
  }
  return $this->pluginDefinition['title'] ?: $this
    ->t('Missing');
}