You are here

public function WebformRequest::getRouteName in Webform 8.5

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

Get the route name for a form/submission and source entity.

Parameters

\Drupal\Core\Entity\EntityInterface $webform_entity: A webform or webform submission.

\Drupal\Core\Entity\EntityInterface|null $source_entity: A webform submission's source entity.

string $route_name: The route name.

Return value

string A route name prefixed with 'entity.{entity_type_id}' or just 'entity'.

Overrides WebformRequestInterface::getRouteName

1 call to WebformRequest::getRouteName()
WebformRequest::getUrl in src/WebformRequest.php
Get the URL for a form/submission and source entity.

File

src/WebformRequest.php, line 242

Class

WebformRequest
Handles webform requests.

Namespace

Drupal\webform

Code

public function getRouteName(EntityInterface $webform_entity, EntityInterface $source_entity = NULL, $route_name) {
  if (!$this
    ->hasSourceEntityWebformRoutes($source_entity)) {
    $source_entity = NULL;
  }
  return $this
    ->getBaseRouteName($webform_entity, $source_entity) . '.' . $route_name;
}