class RedirectResponse extends Response

重定向响应

Traits

ContainerAwareTrait

Methods

setContainer(ContainerInterface $container)

设置依赖注入容器

getContainer()

获取依赖注入容器

__construct(string $url, int $code = 302, string $message = null)

Response constructor.

$this
setStatusCode(int $code, string $message = null)

设置响应状态

from Response
getContentType()

获取响应类型

from Response
$this
setContentType(string $contentType, string $charset = 'UTF-8')

设置响应类型

from Response
string|null
getContent()

获取响应内容

from Response
$this
setContent(string $content = null)

设置响应内容

from Response
array
getCookies()

获取响应的 cookies 信息

from Response
$this
setCookie(array $cookie)

设置响应的 cookie 信息

from Response
array
getHeaders()

获取响应的头信息

from Response
$this
setHeader(string $header, string $value = null)

设置响应头信息

from Response
$this
send()

发送响应数据

from Response
$this
sendContent()

发送响应内容

from Response
$this
sendCookies()

发送响应 cookie

from Response
$this
sendHeaders()

发送响应头

from Response
reset()

No description

from Response
setTargetUrl(string $url)

No description

Details

in ContainerAwareTrait at line 22
setContainer(ContainerInterface $container)

设置依赖注入容器

Parameters

ContainerInterface $container 容器对象实例

in ContainerAwareTrait at line 32
ContainerInterface getContainer()

获取依赖注入容器

Return Value

ContainerInterface

at line 28
__construct(string $url, int $code = 302, string $message = null)

Response constructor.

Parameters

string $url 跳转地址
int $code 状态码
string $message 状态描述

in Response at line 99
$this setStatusCode(int $code, string $message = null)

设置响应状态

Parameters

int $code 状态码
string $message 状态描述

Return Value

$this

in Response at line 110
getContentType()

获取响应类型

in Response at line 127
$this setContentType(string $contentType, string $charset = 'UTF-8')

设置响应类型

$response->setContentType('application/javascript');

Parameters

string $contentType
string $charset

Return Value

$this

in Response at line 140
string|null getContent()

获取响应内容

Return Value

string|null

in Response at line 152
$this setContent(string $content = null)

设置响应内容

Parameters

string $content

Return Value

$this

in Response at line 164
array getCookies()

获取响应的 cookies 信息

Return Value

array

in Response at line 176
$this setCookie(array $cookie)

设置响应的 cookie 信息

Parameters

array $cookie 单个 cookie 信息

Return Value

$this

in Response at line 199
array getHeaders()

获取响应的头信息

Return Value

array

in Response at line 212
$this setHeader(string $header, string $value = null)

设置响应头信息

Parameters

string $header
string $value

Return Value

$this

in Response at line 226
$this send()

发送响应数据

Return Value

$this

in Response at line 247
$this sendContent()

发送响应内容

Return Value

$this

in Response at line 259
$this sendCookies()

发送响应 cookie

Return Value

$this

in Response at line 281
$this sendHeaders()

发送响应头

Return Value

$this

in Response at line 306
reset()

at line 40
setTargetUrl(string $url)

Parameters

string $url