eddsstudio / php-response

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This is very Simple PHP Response class

Simple PHP code

$response = new Response;
$response->data([
	'event_id'=>2, 
	'event'=>'mail', 
	'recipient'=>'somebody@example.com'
]);
return $response->generate();

Returns JSON string formated in JSend specification format

{
	status : "success",
	data : { "event_id" : 2, "event" : "mail", "recipient" : "somebody@example.com" }
}

Another example

$response = new Response();
$response->data = $data;
return $response->generate();

About


Languages

Language:PHP 100.0%