library smart-output
Smart Output for RESTful PHP APIs
professorhaseeb/smart-output
Smart Output for RESTful PHP APIs
- Sunday, January 29, 2017
- by professorhaseeb
- Repository
- 1 Watchers
- 0 Stars
- 0 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 0 Forks
- 0 Open issues
- 1 Versions
- 0 % Grown
Smart Output -
Installation
composer require professorhaseeb/smart-output
Usage
// setup class
$so = new smartOutput();
Setting Response:, (*1)
//set response code in first parameter and the response output in the second
$so->setResponse(0,"RESPONSE DATA");
// Array can be passed too
// $arr = ("request" => "true");
// $so->setResponse(0,$arr);
Get Response:, (*2)
echo json_encode($so->getResponse());
Output:, (*3)
{
"status_code": 0,
"status": "success",
"message": "Request successfull",
"response": "RESPONSE DATA"
}
dev-master
9999999-dev
Smart Output for RESTful PHP APIs
Sources
Download
MIT
The Requires
output
restful
smartooutput