\Symfony\Component\HttpFoundationRedirectResponse

RedirectResponse represents an HTTP response doing a redirect.

Summary

Methods
Properties
Constants
__construct()
create()
getTargetUrl()
setTargetUrl()
No public properties found
No constants found
No protected methods found
$targetUrl
N/A
No private methods found
No private properties found
N/A

Properties

$targetUrl

$targetUrl : 

Type

Methods

__construct()

__construct(string  $url, integer  $status = 302, array  $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

integer $status

The status code (302 by default)

array $headers

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

Throws

\InvalidArgumentException

create()

create(string  $url = '', \Symfony\Component\HttpFoundation\int  $status = 302, array  $headers = array()) : static

Factory method for chainability.

Parameters

string $url

The URL to redirect to

\Symfony\Component\HttpFoundation\int $status
array $headers

Returns

static

getTargetUrl()

getTargetUrl() : string

Returns the target URL.

Returns

string —

target URL

setTargetUrl()

setTargetUrl(\Symfony\Component\HttpFoundation\string  $url) : $this

Sets the redirect target of this response.

Parameters

\Symfony\Component\HttpFoundation\string $url

Throws

\InvalidArgumentException

Returns

$this