class Redirect implements ResponseSenderInterface

Redirect response.

Constants

MULTIPLE_CHOICES

Multiple choices status code.

MOVED_PERMANENTLY

Moved permanently status code.

FOUND

Found status code.

SEE_OTHER

See other status code.

NOT_MODIFIED

Not modified status code.

USE_PROXY

Use proxy status code.

TEMPORARY_REDIRECT

Temporary redirect status code.

PERMANENT_REDIRECT

Permanent redirect status code.

SUPPORTED_STATUS_CODES

Supported redirect types.

Properties

protected string $location Location.
protected int $statusCode Status code.

Methods

__construct(string $location, int $statusCode = self::FOUND)

Constructor.

setStatus(int $statusCode)

Sets the HTTP status code.

multipleChoices() deprecated

Sets the HTTP status code to 300.

movedPermanently()

Sets the HTTP status code to 301.

found()

Sets the HTTP status code to 302.

seeOther()

Sets the HTTP status code to 303.

notModified() deprecated

Sets the HTTP status code to 304.

useProxy() deprecated

Sets the HTTP status code to 305.

temporaryRedirect()

Sets the HTTP status code to 307.

permanentRedirect()

Sets the HTTP status code to 308.

int
getStatus()

Returns the HTTP status code.

send(Request $request, Response $response)

Sends the response.

Details

at line 120
__construct(string $location, int $statusCode = self::FOUND)

Constructor.

Parameters

string $location Location
int $statusCode Status code

at line 133
Redirect setStatus(int $statusCode)

Sets the HTTP status code.

Parameters

int $statusCode Status code

Return Value

Redirect

at line 151
Redirect multipleChoices() deprecated

deprecated 7.0

Sets the HTTP status code to 300.

Return Value

Redirect

at line 163
Redirect movedPermanently()

Sets the HTTP status code to 301.

Return Value

Redirect

at line 175
Redirect found()

Sets the HTTP status code to 302.

Return Value

Redirect

at line 187
Redirect seeOther()

Sets the HTTP status code to 303.

Return Value

Redirect

at line 200
Redirect notModified() deprecated

deprecated 7.0

Sets the HTTP status code to 304.

Return Value

Redirect

at line 213
Redirect useProxy() deprecated

deprecated 7.0

Sets the HTTP status code to 305.

Return Value

Redirect

at line 225
Redirect temporaryRedirect()

Sets the HTTP status code to 307.

Return Value

Redirect

at line 237
Redirect permanentRedirect()

Sets the HTTP status code to 308.

Return Value

Redirect

at line 249
int getStatus()

Returns the HTTP status code.

Return Value

int

at line 257
send(Request $request, Response $response)

Sends the response.

Parameters

Request $request Request instance
Response $response Response instance