You are here

protected function EmailConfirmerResponseForm::getRedirectUrl in Email confirmer 8

Returns the URL to redirect to after the form is completed or skipped.

Parameters

string $operation: Possible values:

  • confirm
  • cancel
  • error

Defines the page that will be redirected to.

Return value

\Drupal\Core\Url The url to redirect to.

5 calls to EmailConfirmerResponseForm::getRedirectUrl()
EmailConfirmerResponseForm::cancelConfirmation in src/Form/EmailConfirmerResponseForm.php
Cancels the email confirmation.
EmailConfirmerResponseForm::confirmationError in src/Form/EmailConfirmerResponseForm.php
Common behaviour when there ware errors in confirmation.
EmailConfirmerResponseForm::confirmConfirmation in src/Form/EmailConfirmerResponseForm.php
Confirms the email confirmation.
EmailConfirmerResponseForm::skipConfirmationForm in src/Form/EmailConfirmerResponseForm.php
Skip the response form and positively confirm the confirmation.
EmailConfirmerResponseForm::submitForm in src/Form/EmailConfirmerResponseForm.php
This is the default entity object builder function. It is called before any other submit handler to build the new entity object to be used by the following submit handlers. At this point of the form workflow the entity is validated and the form state…

File

src/Form/EmailConfirmerResponseForm.php, line 211

Class

EmailConfirmerResponseForm
Email confirmation response form.

Namespace

Drupal\email_confirmer\Form

Code

protected function getRedirectUrl($operation) {

  /** @var \Drupal\email_confirmer\EmailConfirmationInterface $confirmation */
  $confirmation = $this
    ->getEntity();

  // Go to confirmation response URL, response path from settings or front.
  if (!($url = $confirmation
    ->getResponseUrl($operation))) {
    $path = $this
      ->config('email_confirmer.settings')
      ->get('confirmation_response.url.' . $operation) ?: '<front>';
    $url = Url::fromUri('internal:/' . $path);
  }
  return $url;
}