PHP Class Bluz\Cli\CliResponse

Allows creating a response by passing data to the constructor; by default, serializes the data to JSON, sets a status code of 200 and sets the Content-Type header to application/json.
Inheritance: extends Zend\Diactoros\Response
Show file Open project: bluzphp/framework

Public Methods

Method Description
__construct ( mixed $data, integer $status = 200 ) Create a console response with the given data.

Private Methods

Method Description
encode ( mixed $data ) : string Encode the provided data to JSON.

Method Details

__construct() public method

Create a console response with the given data.
public __construct ( mixed $data, integer $status = 200 )
$data mixed Data to convert to string
$status integer Integer status code for the response; 200 by default.