You are here

public function TrustedRedirectResponse::__construct in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/Routing/TrustedRedirectResponse.php \Drupal\Core\Routing\TrustedRedirectResponse::__construct()

Creates a redirect response so that it conforms to the rules defined for a redirect status code.

Parameters

string $url The URL to redirect to:

int $status The status code (302 by default):

array $headers The headers (Location is always set to the given URL):

Throws

\InvalidArgumentException

Overrides RedirectResponse::__construct

See also

http://tools.ietf.org/html/rfc2616#section-10.3

File

core/lib/Drupal/Core/Routing/TrustedRedirectResponse.php, line 29
Contains \Drupal\Core\Routing\TrustedRedirectResponse.

Class

TrustedRedirectResponse
Provides a redirect response which contains trusted URLs.

Namespace

Drupal\Core\Routing

Code

public function __construct($url, $status = 302, $headers = array()) {
  $this->trustedUrls[$url] = TRUE;
  parent::__construct($url, $status, $headers);
}