You are here

public function SearchLinks::routeExists in Admin Toolbar 3.x

Same name and namespace in other branches
  1. 8.2 admin_toolbar_search/src/SearchLinks.php \Drupal\admin_toolbar_search\SearchLinks::routeExists()

Determine if a route exists by name.

Parameters

string $route_name: The name of the route to check.

Return value

bool Whether a route with that route name exists.

1 call to SearchLinks::routeExists()
SearchLinks::getLinks in admin_toolbar_search/src/SearchLinks.php
Gets extra links for admin toolbar search feature.

File

admin_toolbar_search/src/SearchLinks.php, line 313

Class

SearchLinks
Extra search links.

Namespace

Drupal\admin_toolbar_search

Code

public function routeExists($route_name) {
  return count($this->routeProvider
    ->getRoutesByNames([
    $route_name,
  ])) === 1;
}