You are here

public function WebformRequest::getUrl in Webform 8.5

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

Get the URL 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.

array $route_options: The route options.

Return value

\Drupal\Core\Url The URL for a form/submission and source entity.

Overrides WebformRequestInterface::getUrl

2 calls to WebformRequest::getUrl()
WebformRequest::getCurrentWebformSubmissionUrl in src/WebformRequest.php
Get the URL for the current webform submission and source entity.
WebformRequest::getCurrentWebformUrl in src/WebformRequest.php
Get the URL for the current webform and source entity.

File

src/WebformRequest.php, line 233

Class

WebformRequest
Handles webform requests.

Namespace

Drupal\webform

Code

public function getUrl(EntityInterface $webform_entity, EntityInterface $source_entity = NULL, $route_name, array $route_options = []) {
  $route_name = $this
    ->getRouteName($webform_entity, $source_entity, $route_name);
  $route_parameters = $this
    ->getRouteParameters($webform_entity, $source_entity);
  return Url::fromRoute($route_name, $route_parameters, $route_options);
}