PHP Class Yosymfony\Spress\HttpServer\ServerResponse

Author: Victor Puertas ([email protected])
Show file Open project: spress/spress Class Usage Examples

Public Methods

Method Description
__construct ( string $content, integer $statusCode = 200, string $contentType = 'text/html' ) Constructor.
getContent ( ) : string Get the content of the response.
getContentType ( ) : string Get the MIME type.
getStatusCode ( ) : integer Get the status code.
setContent ( string $content ) Set the content of the response.
setContentType ( string $type ) Set the MIME type. e.g: 'text/html'.
setStatusCode ( integer $code ) Set the status code. e.g: 200 for ok response.

Method Details

__construct() public method

Constructor.
public __construct ( string $content, integer $statusCode = 200, string $contentType = 'text/html' )
$content string Content of the response
$statusCode integer The status code
$contentType string The MIME type

getContent() public method

Get the content of the response.
public getContent ( ) : string
return string

getContentType() public method

Get the MIME type.
public getContentType ( ) : string
return string

getStatusCode() public method

Get the status code.
public getStatusCode ( ) : integer
return integer

setContent() public method

Set the content of the response.
public setContent ( string $content )
$content string

setContentType() public method

Set the MIME type. e.g: 'text/html'.
public setContentType ( string $type )
$type string

setStatusCode() public method

Set the status code. e.g: 200 for ok response.
public setStatusCode ( integer $code )
$code integer