-
Notifications
You must be signed in to change notification settings - Fork 0
RedirectResponse
github-actions edited this page Mar 29, 2026
·
1 revision
Class RedirectResponse.
Represents an HTTP redirect response with customizable status codes for temporary or permanent redirects. This class MUST be used for generating HTTP responses that instruct clients to navigate to a different location, by automatically setting the 'Location' header.
- Full name:
\FastForward\Http\Message\RedirectResponse - Parent class:
Response - This class is marked as final and can't be subclassed
- This class is a Final class
Constructs a new RedirectResponse instance.
public __construct(string|\Psr\Http\Message\UriInterface $uri, bool $permanent = false, array $headers = []): mixedThis constructor SHALL set the 'Location' header and apply the appropriate HTTP status code for temporary (302 Found) or permanent (301 Moved Permanently) redirects.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$uri |
string|\Psr\Http\Message\UriInterface | The target URI for redirection. MUST be absolute or relative according to context. |
$permanent |
bool | if true, the response status will be 301 (permanent redirect); otherwise, 302 (temporary redirect) |
$headers |
array | optional additional headers to include in the response |