- $tags = $this->getDoctrine()
- ->getRepository('WallabagCoreBundle:Tag')
- ->findAllTags($this->getUser()->getId());
-
- return $this->render(
- 'WallabagCoreBundle:Tag:tags.html.twig',
- [
- 'tags' => $tags,
- ]
+ $tags = $this->get('wallabag_core.tag_repository')
+ ->findAllFlatTagsWithNbEntries($this->getUser()->getId());
+
+ return $this->render('WallabagCoreBundle:Tag:tags.html.twig', [
+ 'tags' => $tags,
+ ]);
+ }
+
+ /**
+ * @param Tag $tag
+ * @param int $page
+ *
+ * @Route("/tag/list/{slug}/{page}", name="tag_entries", defaults={"page" = "1"})
+ * @ParamConverter("tag", options={"mapping": {"slug": "slug"}})
+ *
+ * @return \Symfony\Component\HttpFoundation\Response
+ */
+ public function showEntriesForTagAction(Tag $tag, $page, Request $request)
+ {
+ $entriesByTag = $this->get('wallabag_core.entry_repository')->findAllByTagId(
+ $this->getUser()->getId(),
+ $tag->getId()