You are here

public function LoginLogoutMenuLink::getTitle in OAuth2 Login 8

Returns the localized title to be shown for this link.

Return value

string The title of the menu link.

Overrides MenuLinkDefault::getTitle

File

src/Plugin/Menu/LoginLogoutMenuLink.php, line 58

Class

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

Namespace

Drupal\oauth2_login\Plugin\Menu

Code

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