From 51ee652e587f7f9a3189d8816566356db33a0d30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Wed, 8 Jan 2014 10:55:28 +0100 Subject: [PATCH] [add] route for article view --- app/controllers/front.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/controllers/front.php b/app/controllers/front.php index 93c1222..1df8566 100644 --- a/app/controllers/front.php +++ b/app/controllers/front.php @@ -11,6 +11,13 @@ $front->get('/', function () use ($app) { return $app['twig']->render('index.twig', array('entries' => $entries)); }); +$front->get('/view/{id}', function (Request $request, $id) use ($app) { + + $entry = $app['entry_api']->getEntryById($id); + + return $app['twig']->render('view.twig', array('entry' => $entry)); +}); + $front->match('/add', function (Request $request) use ($app) { $data = array('url');