From b846c1e4d03ec51ae6b740040d79d47d9bdec12c Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20HULARD?= Date: Wed, 24 Jan 2018 18:04:39 +0100 Subject: [PATCH 1/1] 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. --- src/Wallabag/CoreBundle/Controller/TagController.php | 6 ++++++ 1 file changed, 6 insertions(+) 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 $tags = $this->get('wallabag_core.tag_repository') ->findAllFlatTagsWithNbEntries($this->getUser()->getId()); + $renameForms = []; + foreach ($tags as $tag) { + $renameForms[$tag['id']] = $this->createForm(RenameTagType::class, new Tag())->createView(); + } + return $this->render('WallabagCoreBundle:Tag:tags.html.twig', [ 'tags' => $tags, + 'renameForms' => $renameForms, ]); } -- 2.41.0