fitlet/json-response-builder

Standarized JSON Response builder extension for PHP Slim framework.

0.1.4 2018-06-25 18:12 UTC

This package is not auto-updated.

Last update: 2025-07-20 09:40:17 UTC


README

Build Status

Json Response Wrapper is a library which is responsible for wrapping PHP Slim Response to json standardized format.

Wrapping response

Wrapping process is described in example below.

public function testAction(Response $res, Request $req)
{
    $jsonResponse = JsonResponseFactory::success("test message", []);
    
    return JsonResponseWrapper::newInstance()
        ->withJsonResponse($jsonResponse)
        ->wrap($res);
}