You are here

protected function YamlFormSubmissionForm::setTrustedRedirectUrl in YAML Form 8

Set form 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 YamlFormSubmissionForm::setTrustedRedirectUrl()
YamlFormSubmissionForm::setConfirmation in src/YamlFormSubmissionForm.php
Set form state confirmation redirect and message.

File

src/YamlFormSubmissionForm.php, line 1058

Class

YamlFormSubmissionForm
Provides a form to collect and edit submissions.

Namespace

Drupal\yamlform

Code

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