+ $flatTags = [];
+
+ foreach ($tags as $tag) {
+ $nbEntries = $repository->countAllEntriesByUserIdAndTagId(
+ $this->getUser()->getId(),
+ $tag->getId()
+ );
+
+ $flatTags[] = [
+ 'id' => $tag->getId(),
+ 'label' => $tag->getLabel(),
+ 'slug' => $tag->getSlug(),
+ 'nbEntries' => $nbEntries,
+ ];
+ }
+
+ return $this->render('WallabagCoreBundle:Tag:tags.html.twig', [
+ 'tags' => $flatTags,
+ ]);
+ }
+
+ /**
+ * @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()