You are here

public function MyBlogLink::getRouteName in Blog 3.x

Same name and namespace in other branches
  1. 8.2 src/Plugin/Menu/MyBlogLink.php \Drupal\blog\Plugin\Menu\MyBlogLink::getRouteName()

Returns the route name, if available.

Return value

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

Overrides MenuLinkBase::getRouteName

File

src/Plugin/Menu/MyBlogLink.php, line 53

Class

MyBlogLink
Represents a menu link for "My blog".

Namespace

Drupal\blog\Plugin\Menu

Code

public function getRouteName() {
  if ($this->currentUser
    ->isAuthenticated()) {
    return 'view.blog.blog_user_all';
  }
  else {
    return '';
  }
}