professorhaseeb / smart-output
Smart Output for RESTful PHP APIs
Installs: 4
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/professorhaseeb/smart-output
Requires
- php: >=5.5.0
This package is not auto-updated.
Last update: 2025-10-12 02:03:50 UTC
README
##Installation
composer require professorhaseeb/smart-output
##Usage
// setup class $so = new smartOutput();
Setting Response:
//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:
echo json_encode($so->getResponse());
Output:
{ "status_code": 0, "status": "success", "message": "Request successfull", "response": "RESPONSE DATA" }