From b97ec0ea52aac5c757a83d831417c254a5d97349 Mon Sep 17 00:00:00 2001 From: Nicolas Pineau Date: Thu, 12 Jan 2023 23:49:55 +0100 Subject: [PATCH] :sparkles: allow multiple selection in tree --- README.md | 24 ++++++++++++++++++++++ Resources/views/form/themes/tree.html.twig | 3 ++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 13ea4af..59f9c58 100644 --- a/README.md +++ b/README.md @@ -192,6 +192,30 @@ class MediaCrudController extends AbstractCategorizedCrudController } ``` +If you wish to use the tree field with a ManyToMany relation, just set field attribute `multiple` to true : +```php +setFormTypeOption('multiple', true), + // ... + ]; + } +``` + ### Screenshots Tree structure on index page ![screenshot1](doc/screenshots/1.jpg "Content's entries as a tree structure") diff --git a/Resources/views/form/themes/tree.html.twig b/Resources/views/form/themes/tree.html.twig index 4da9d8f..4ceb8b7 100644 --- a/Resources/views/form/themes/tree.html.twig +++ b/Resources/views/form/themes/tree.html.twig @@ -1,6 +1,7 @@ {% block tree_field_widget %}