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.
This commit is contained in:
Stéphane HULARD 2018-01-24 18:04:39 +01:00 committed by Jeremy Benoist
parent be326a22f9
commit b846c1e4d0
No known key found for this signature in database
GPG key ID: BCA73962457ACC3C

View file

@ -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,
]);
}