From 99c6d290c61452d02fdf2efe65fcec8ea4ffeeff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Thu, 9 Jan 2014 21:07:16 +0100 Subject: [PATCH] [add] routing for archive --- app/controllers/front.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/controllers/front.php b/app/controllers/front.php index a2ba3c0..cd9fe3c 100644 --- a/app/controllers/front.php +++ b/app/controllers/front.php @@ -6,7 +6,7 @@ use Symfony\Component\HttpFoundation\Request; $front = $app['controllers_factory']; $front->get('/', function () use ($app) { - $entries = $app['entry_api']->getEntries(); + $entries = $app['entry_api']->getEntries('unread'); return $app['twig']->render('index.twig', array('entries' => $entries)); }); @@ -49,4 +49,11 @@ $front->match('/add', function (Request $request) use ($app) { }) ->bind('add'); +$front->get('/archive', function () use ($app) { + + $entries = $app['entry_api']->getEntries('read'); + + return $app['twig']->render('archive.twig', array('entries' => $entries)); +}); + return $front;