ContactForm::getRedirectUrl

public ContactForm::getRedirectUrl()

Returns the url object for redirect path.

Empty redirect property results a url object of front page.

Return value

\Drupal\core\Url The redirect url object.

Overrides ContactFormInterface::getRedirectUrl

File

core/modules/contact/src/Entity/ContactForm.php, line 139

Class

ContactForm
Defines the contact form entity.

Namespace

Drupal\contact\Entity

Code

public function getRedirectUrl() {
  if ($this->redirect) {
    $url = Url::fromUserInput($this->redirect);
  }
  else {
    $url = Url::fromRoute('<front>');
  }
  return $url;
}
doc_Drupal
2016-10-29 08:56:21
Comments
Leave a Comment

Please login to continue.