You are here

public function LoginLogoutMenuLink::getRouteName in SAML Authentication 4.x

Same name and namespace in other branches
  1. 8.3 src/Plugin/Menu/LoginLogoutMenuLink.php \Drupal\samlauth\Plugin\Menu\LoginLogoutMenuLink::getRouteName()
  2. 8.2 src/Plugin/Menu/LoginLogoutMenuLink.php \Drupal\samlauth\Plugin\Menu\LoginLogoutMenuLink::getRouteName()

Returns the route name, if available.

Return value

string The name of the route this menu link links to.

Overrides LoginLogoutMenuLink::getRouteName

File

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

Class

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

Namespace

Drupal\samlauth\Plugin\Menu

Code

public function getRouteName() {
  if ($this->currentUser
    ->isAuthenticated()) {
    return 'samlauth.saml_controller_logout';
  }
  else {
    return 'samlauth.saml_controller_login';
  }
}