From bd9f08157cc10619e9bb9dace6df43090dde44a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Thu, 22 Jan 2015 21:11:22 +0100 Subject: article view, fav list, archive list --- src/WallabagBundle/Controller/EntryController.php | 47 ++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) (limited to 'src/WallabagBundle/Controller') diff --git a/src/WallabagBundle/Controller/EntryController.php b/src/WallabagBundle/Controller/EntryController.php index 0c0c1569..233a6c32 100644 --- a/src/WallabagBundle/Controller/EntryController.php +++ b/src/WallabagBundle/Controller/EntryController.php @@ -11,7 +11,7 @@ class EntryController extends Controller /** * @Route("/unread", name="unread") */ - public function unreadAction() + public function showUnreadAction() { $repository = $this->getDoctrine()->getRepository('WallabagBundle:Entries'); $entries = $repository->findUnreadByUser(1); @@ -22,4 +22,49 @@ class EntryController extends Controller ); } + + /** + * @Route("/archive", name="archive") + */ + public function showArchiveAction() + { + $repository = $this->getDoctrine()->getRepository('WallabagBundle:Entries'); + $entries = $repository->findArchiveByUser(1); + + return $this->render( + 'WallabagBundle:Entry:entries.html.twig', + array('entries' => $entries) + ); + + } + + /** + * @Route("/starred", name="starred") + */ + public function showStarredAction() + { + $repository = $this->getDoctrine()->getRepository('WallabagBundle:Entries'); + $entries = $repository->findStarredByUser(1); + + return $this->render( + 'WallabagBundle:Entry:entries.html.twig', + array('entries' => $entries) + ); + + } + + /** + * @Route("/view/{id}", requirements={"id" = "\d+"}, name="view") + */ + public function viewAction($id) + { + $repository = $this->getDoctrine()->getRepository('WallabagBundle:Entries'); + $entry = $repository->find($id); + + return $this->render( + 'WallabagBundle:Entry:entry.html.twig', + array('entry' => $entry) + ); + + } } -- cgit v1.2.3