I am using the Slim framework with PHP to create a RESTful API for my app. However, I assumed that the framework would have some way of creating easier JSON outputs rather than
This is how I do it in slim version 2
$app->response->headers->set("Content-Type", 'application/json'); return $app->response->write(json_encode([ 'status' => true, 'message' => 'Your message' ]));