You are here

protected function WebformRequest::routeExists in Webform 8.5

Same name and namespace in other branches
  1. 6.x src/WebformRequest.php \Drupal\webform\WebformRequest::routeExists()

Check if route exists.

Parameters

string $name: Route name.

Return value

bool TRUE if the route exists.

See also

http://drupal.stackexchange.com/questions/222591/how-do-i-verify-a-route...

1 call to WebformRequest::routeExists()
WebformRequest::hasSourceEntityWebformRoutes in src/WebformRequest.php
Check if a source entity has dedicate webform routes.

File

src/WebformRequest.php, line 355

Class

WebformRequest
Handles webform requests.

Namespace

Drupal\webform

Code

protected function routeExists($name) {
  try {
    $this->routeProvider
      ->getRouteByName($name);
    return TRUE;
  } catch (\Exception $exception) {
    return FALSE;
  }
}