abstract class Response_Abstract (View source)

Constants

DEFAULT_BODY

Properties

protected string $_header
protected string $_body
protected bool $_sendheader

Methods

__construct()

No description

__destruct()

No description

__toString()

No description

bool
setBody(string $content, string $key = self::DEFAULT_BODY)

Set content to response

bool
appendBody(string $content, string $key = self::DEFAULT_BODY)

append a content to a exists content block

bool
prependBody(string $content, string $key = self::DEFAULT_BODY)

prepend a content to a exists content block

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

Clear existing content

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

Retrieve an existing content

Details

__construct()

No description

__destruct()

No description

__toString()

No description

bool setBody(string $content, string $key = self::DEFAULT_BODY)

Set content to response

Parameters

string $content

content string

string $key

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 $content, string $key = self::DEFAULT_BODY)

append a content to a exists content block

Parameters

string $content

content string

string $key

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 $content, string $key = self::DEFAULT_BODY)

prepend a content to a exists content block

Parameters

string $content

content string

string $key

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 $key = self::DEFAULT_BODY)

Clear existing content

Parameters

string $key

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 $key = self::DEFAULT_BODY)

Retrieve an existing content

Parameters

string|null $key

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