TrustedRedirectResponse::__construct

public TrustedRedirectResponse::__construct($url, $status = 302, $headers = array())

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. The URL should be a full URL, with schema etc.,: but practically every browser redirects on paths only as well

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 24

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);
}
doc_Drupal
2016-10-29 09:49:36
Comments
Leave a Comment

Please login to continue.