From 723fce50b6577d4caf86c580ca73da7c36639f54 Mon Sep 17 00:00:00 2001 From: Vincent Jousse Date: Fri, 22 Nov 2013 22:48:06 +0100 Subject: [PATCH] Use built-in json renderer --- app/controllers/api.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/api.php b/app/controllers/api.php index cab3000..1df215c 100644 --- a/app/controllers/api.php +++ b/app/controllers/api.php @@ -6,7 +6,7 @@ $api->get('/', function () { return 'API home page'; }); $api->get('/entries', function () use ($app) { $entries = $app['entry_api']->getEntries(); - return json_encode($entries); + return $app->json($entry, 200); }); return $api;