class Yaf_Response_Http extends Yaf_Response_Abstract (View source)

Constants

DEFAULT_BODY

Properties

protected string $_header from  Yaf_Response_Abstract
protected string $_body from  Yaf_Response_Abstract
protected bool $_sendheader from  Yaf_Response_Abstract
protected int $_response_code

Methods

__construct()

No description

__destruct()

No description

__toString()

No description

void
response()

send response

bool
setHeader(string $name = '', string $value = '', bool $rep = false, int $response_code = 0)

No description

bool
setBody(string $body, string $name = self::DEFAULT_BODY)

Set content to response

bool
appendBody(string $body, string $name = self::DEFAULT_BODY)

append a content to a exists content block

bool
prependBody(string $body, string $name = self::DEFAULT_BODY)

prepend a content to a exists content block

bool
clearBody(string $name = self::DEFAULT_BODY)

Clear existing content

mixed
getBody(string|null $name = self::DEFAULT_BODY)

Retrieve an existing content

bool
setAllHeaders(array $headers)

No description

mixed
getHeader(string $name = null)

No description

clearHeaders()

No description

bool
setRedirect(string $url)

No description

Details

__construct()

No description

__destruct()

No description

__toString()

No description

void response()

send response

Return Value

void

bool setHeader(string $name = '', string $value = '', bool $rep = false, int $response_code = 0)

No description

Parameters

string $name
string $value
bool $rep
int $response_code

Return Value

bool

bool setBody(string $body, string $name = self::DEFAULT_BODY)

Set content to response

Parameters

string $body

content string

string $name

the content key, you can set a content with a key, if you don't specific, then Yaf_Response_Abstract::DEFAULT_BODY will be used


Note:

this parameter is introduced as of 2.2.0

Return Value

bool

bool appendBody(string $body, string $name = self::DEFAULT_BODY)

append a content to a exists content block

Parameters

string $body

content string

string $name

the content key, you can set a content with a key, if you don't specific, then Yaf_Response_Abstract::DEFAULT_BODY will be used


Note:

this parameter is introduced as of 2.2.0

Return Value

bool

bool prependBody(string $body, string $name = self::DEFAULT_BODY)

prepend a content to a exists content block

Parameters

string $body

content string

string $name

the content key, you can set a content with a key, if you don't specific, then Yaf_Response_Abstract::DEFAULT_BODY will be used


Note:

this parameter is introduced as of 2.2.0

Return Value

bool

bool clearBody(string $name = self::DEFAULT_BODY)

Clear existing content

Parameters

string $name

the content key, you can set a content with a key, if you don't specific, then Yaf_Response_Abstract::DEFAULT_BODY will be used


Note:

this parameter is introduced as of 2.2.0

Return Value

bool

mixed getBody(string|null $name = self::DEFAULT_BODY)

Retrieve an existing content

Parameters

string|null $name

the content key, if you don't specific, then Yaf_Response_Abstract::DEFAULT_BODY will be used. if you pass in a NULL, then all contents will be returned as a array


Note:

this parameter is introduced as of 2.2.0

Return Value

mixed

bool setAllHeaders(array $headers)

No description

Parameters

array $headers

Return Value

bool

mixed getHeader(string $name = null)

No description

Parameters

string $name

Return Value

mixed

Yaf_Response_Abstract|false clearHeaders()

No description

Return Value

Yaf_Response_Abstract|false

bool setRedirect(string $url)

No description

Parameters

string $url

Return Value

bool