You are here

protected function WebformSubmissionForm::setTrustedRedirectUrl in Webform 8.5

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

Set webform state to redirect to a trusted redirect response.

Parameters

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

\Drupal\Core\Url $url: A URL object.

1 call to WebformSubmissionForm::setTrustedRedirectUrl()
WebformSubmissionForm::setConfirmation in src/WebformSubmissionForm.php
Set webform state confirmation redirect and message.

File

src/WebformSubmissionForm.php, line 2376

Class

WebformSubmissionForm
Provides a webform to collect and edit submissions.

Namespace

Drupal\webform

Code

protected function setTrustedRedirectUrl(FormStateInterface $form_state, Url $url) {
  $form_state
    ->setResponse(new TrustedRedirectResponse($url
    ->setAbsolute()
    ->toString()));
}