Class RedirectResponse
RedirectResponse represents an HTTP response doing a redirect.
-
Symfony\Component\HttpFoundation\Response
-
Symfony\Component\HttpFoundation\RedirectResponse
Methods summary
public
|
#
__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.
Creates a redirect response so that it conforms to the rules defined for a
redirect status code.
Parameters
- $url
string $url The URL to redirect to
- $status
integer $status The status code (302 by default)
- $headers
array $headers The headers (Location is always set to the given url)
Throws
See
Api
Overrides
|
public static
Symfony\Component\HttpFoundation\Response
|
#
create( string $url = '', integer $status = 302, array $headers = array() )
Factory method for chainability
Factory method for chainability
Parameters
- $url
string $content The response content
- $status
integer $status The response status code
- $headers
array $headers An array of response headers
Returns
Overrides
|
public
string
|
#
getTargetUrl( )
Returns the target URL.
Returns
string target URL
|
public
Symfony\Component\HttpFoundation\RedirectResponse
|
#
setTargetUrl( string $url )
Sets the redirect target of this response.
Sets the redirect target of this response.
Parameters
- $url
string $url The URL to redirect to
Returns
Throws
|
Methods inherited from Symfony\Component\HttpFoundation\Response
__clone(),
__toString(),
expire(),
getAge(),
getCharset(),
getContent(),
getDate(),
getEtag(),
getExpires(),
getLastModified(),
getMaxAge(),
getProtocolVersion(),
getStatusCode(),
getTtl(),
getVary(),
hasVary(),
isCacheable(),
isClientError(),
isEmpty(),
isForbidden(),
isFresh(),
isInformational(),
isInvalid(),
isNotFound(),
isNotModified(),
isOk(),
isRedirect(),
isRedirection(),
isServerError(),
isSuccessful(),
isValidateable(),
mustRevalidate(),
prepare(),
send(),
sendContent(),
sendHeaders(),
setCache(),
setCharset(),
setClientTtl(),
setContent(),
setDate(),
setEtag(),
setExpires(),
setLastModified(),
setMaxAge(),
setNotModified(),
setPrivate(),
setProtocolVersion(),
setPublic(),
setSharedMaxAge(),
setStatusCode(),
setTtl(),
setVary()
|