aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStéphane HULARD <s.hulard@chstudio.fr>2018-01-24 18:04:39 +0100
committerJeremy Benoist <jeremy.benoist@gmail.com>2018-09-25 10:18:08 +0200
commitb846c1e4d03ec51ae6b740040d79d47d9bdec12c (patch)
treee99d5d8ecaf4217076c38e495d4ab8b2ef03929f
parentbe326a22f90a5f4006ff41ee7b4ed0ca73a8fddd (diff)
downloadwallabag-b846c1e4d03ec51ae6b740040d79d47d9bdec12c.tar.gz
wallabag-b846c1e4d03ec51ae6b740040d79d47d9bdec12c.tar.zst
wallabag-b846c1e4d03ec51ae6b740040d79d47d9bdec12c.zip
Add RenameForm as tag list view parameters.
This will help handling the CSRF protection token and use symfony HTML generation layer. Also a FormView instance is generated for each tag because we need to render a form for each tag and FormView are not reusable.
-rw-r--r--src/Wallabag/CoreBundle/Controller/TagController.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Controller/TagController.php b/src/Wallabag/CoreBundle/Controller/TagController.php
index 70b273e0..a041510d 100644
--- a/src/Wallabag/CoreBundle/Controller/TagController.php
+++ b/src/Wallabag/CoreBundle/Controller/TagController.php
@@ -88,8 +88,14 @@ class TagController extends Controller
88 $tags = $this->get('wallabag_core.tag_repository') 88 $tags = $this->get('wallabag_core.tag_repository')
89 ->findAllFlatTagsWithNbEntries($this->getUser()->getId()); 89 ->findAllFlatTagsWithNbEntries($this->getUser()->getId());
90 90
91 $renameForms = [];
92 foreach ($tags as $tag) {
93 $renameForms[$tag['id']] = $this->createForm(RenameTagType::class, new Tag())->createView();
94 }
95
91 return $this->render('WallabagCoreBundle:Tag:tags.html.twig', [ 96 return $this->render('WallabagCoreBundle:Tag:tags.html.twig', [
92 'tags' => $tags, 97 'tags' => $tags,
98 'renameForms' => $renameForms,
93 ]); 99 ]);
94 } 100 }
95 101