codearchitect / json_response
Take the value user assign/enter to the properties of the class. And return the json formatted response.
Installs: 1
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 1
Open Issues: 0
pkg:composer/codearchitect/json_response
Requires
- php: >=5.4.
- ext-json: *
This package is auto-updated.
Last update: 2025-10-12 00:04:42 UTC
README
#json-responser-package Take the value user assign/enter to the properties of the class. And return the json formatted response.
Installation
composer require codearchitect/json_response
Usage
require_once "vendor/autoload.php"; $test= [ 'name' => 'code-architect', 'task' => 'developer', 'email' => 'email@xyz.com', 'tech' => ['php', 'mysql', 'mongodb', 'elastic-search'] ]; new \CodeArchitect\ResponseClass\JsonResponse('ok', '', $test);
Param 1 (required)
- success or ok - 200 http status
- unauthorized - 401 http status
- exception - 500 http status
Param 2 (optional)
string - the return message, use empty quote if message is not available
Param 3 (required)
array - data array