You are here

public function LoginLogoutMenuLink::getTitle in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/user/src/Plugin/Menu/LoginLogoutMenuLink.php \Drupal\user\Plugin\Menu\LoginLogoutMenuLink::getTitle()

Returns the localized title to be shown for this link.

Return value

string The title of the menu link.

Overrides MenuLinkDefault::getTitle

File

core/modules/user/src/Plugin/Menu/LoginLogoutMenuLink.php, line 63
Contains \Drupal\user\Plugin\Menu\LoginLogoutMenuLink.

Class

LoginLogoutMenuLink
A menu link that shows "Log in" or "Log out" as appropriate.

Namespace

Drupal\user\Plugin\Menu

Code

public function getTitle() {
  if ($this->currentUser
    ->isAuthenticated()) {
    return $this
      ->t('Log out');
  }
  else {
    return $this
      ->t('Log in');
  }
}