]>
Commit | Line | Data |
---|---|---|
9d50517c NL |
1 | <?php |
2 | ||
3 | namespace WallabagBundle\Controller; | |
4 | ||
5 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; | |
6 | use Symfony\Bundle\FrameworkBundle\Controller\Controller; | |
7 | use WallabagBundle\Repository; | |
8 | ||
9 | class EntryController extends Controller | |
10 | { | |
11 | /** | |
12 | * @Route("/unread", name="unread") | |
13 | */ | |
bd9f0815 | 14 | public function showUnreadAction() |
9d50517c NL |
15 | { |
16 | $repository = $this->getDoctrine()->getRepository('WallabagBundle:Entries'); | |
17 | $entries = $repository->findUnreadByUser(1); | |
18 | ||
19 | return $this->render( | |
20 | 'WallabagBundle:Entry:entries.html.twig', | |
21 | array('entries' => $entries) | |
22 | ); | |
23 | ||
24 | } | |
bd9f0815 NL |
25 | |
26 | /** | |
27 | * @Route("/archive", name="archive") | |
28 | */ | |
29 | public function showArchiveAction() | |
30 | { | |
31 | $repository = $this->getDoctrine()->getRepository('WallabagBundle:Entries'); | |
32 | $entries = $repository->findArchiveByUser(1); | |
33 | ||
34 | return $this->render( | |
35 | 'WallabagBundle:Entry:entries.html.twig', | |
36 | array('entries' => $entries) | |
37 | ); | |
38 | ||
39 | } | |
40 | ||
41 | /** | |
42 | * @Route("/starred", name="starred") | |
43 | */ | |
44 | public function showStarredAction() | |
45 | { | |
46 | $repository = $this->getDoctrine()->getRepository('WallabagBundle:Entries'); | |
47 | $entries = $repository->findStarredByUser(1); | |
48 | ||
49 | return $this->render( | |
50 | 'WallabagBundle:Entry:entries.html.twig', | |
51 | array('entries' => $entries) | |
52 | ); | |
53 | ||
54 | } | |
55 | ||
56 | /** | |
57 | * @Route("/view/{id}", requirements={"id" = "\d+"}, name="view") | |
58 | */ | |
59 | public function viewAction($id) | |
60 | { | |
61 | $repository = $this->getDoctrine()->getRepository('WallabagBundle:Entries'); | |
62 | $entry = $repository->find($id); | |
63 | ||
64 | return $this->render( | |
65 | 'WallabagBundle:Entry:entry.html.twig', | |
66 | array('entry' => $entry) | |
67 | ); | |
68 | ||
69 | } | |
9d50517c | 70 | } |