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
I think Slim also provides a middleware object which does this automatically so users of that framework doesnt have to write json_decode and encode on every request, its called the
Slim_Middleware_ContentType
object.
$app->response()->('application/json');
$app->add(new Slim_Middleware_ContentType());
it does the decoding for you. the decoding works great.But for encoding the last post is great.
Thanks, Dharani