public function LoginLogoutMenuLink::getRouteName in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/user/src/Plugin/Menu/LoginLogoutMenuLink.php \Drupal\user\Plugin\Menu\LoginLogoutMenuLink::getRouteName()
 
Returns the route name, if available.
Return value
string The name of the route this menu link links to.
Overrides MenuLinkBase::getRouteName
File
- core/
modules/ user/ src/ Plugin/ Menu/ LoginLogoutMenuLink.php, line 75  - Contains \Drupal\user\Plugin\Menu\LoginLogoutMenuLink.
 
Class
- LoginLogoutMenuLink
 - A menu link that shows "Log in" or "Log out" as appropriate.
 
Namespace
Drupal\user\Plugin\MenuCode
public function getRouteName() {
  if ($this->currentUser
    ->isAuthenticated()) {
    return 'user.logout';
  }
  else {
    return 'user.login';
  }
}