+ $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,
+ ]);