mirror of
https://github.com/wallabag/wallabag.git
synced 2024-10-31 22:28:54 +00:00
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:
parent
be326a22f9
commit
b846c1e4d0
1 changed files with 6 additions and 0 deletions
|
@ -88,8 +88,14 @@ class TagController extends Controller
|
||||||
$tags = $this->get('wallabag_core.tag_repository')
|
$tags = $this->get('wallabag_core.tag_repository')
|
||||||
->findAllFlatTagsWithNbEntries($this->getUser()->getId());
|
->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', [
|
return $this->render('WallabagCoreBundle:Tag:tags.html.twig', [
|
||||||
'tags' => $tags,
|
'tags' => $tags,
|
||||||
|
'renameForms' => $renameForms,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue