You are here

public function Response::isRedirect in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/http-foundation/Response.php \Symfony\Component\HttpFoundation\Response::isRedirect()

Is the response a redirect of some form?

Parameters

string $location:

Return value

bool

1 call to Response::isRedirect()
RedirectResponse::__construct in vendor/symfony/http-foundation/RedirectResponse.php
Creates a redirect response so that it conforms to the rules defined for a redirect status code.

File

vendor/symfony/http-foundation/Response.php, line 1120

Class

Response
Response represents an HTTP response.

Namespace

Symfony\Component\HttpFoundation

Code

public function isRedirect($location = null) {
  return in_array($this->statusCode, array(
    201,
    301,
    302,
    303,
    307,
    308,
  )) && (null === $location ?: $location == $this->headers
    ->get('Location'));
}