]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/WallabagBundle/Controller/EntryController.php
article view, fav list, archive list
[github/wallabag/wallabag.git] / src / WallabagBundle / Controller / EntryController.php
index 0c0c156905b9d899a240ca2421fdcec0b1335eb6..233a6c32bcf37946368eaf570e78e69023c24680 100644 (file)
@@ -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)
+        );
+
+    }
 }