File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -213,6 +213,12 @@ Previously you added two tags to your task in the controller. Now let the users
213213add as many tag forms as they need directly in the browser. This requires a bit
214214of JavaScript code.
215215
216+ .. tip ::
217+
218+ Instead of writing the needed JavaScript code yourself, you can use Symfony
219+ UX to implement this feature with only PHP and Twig code. See the
220+ `Symfony UX Demo of Form Collections `_.
221+
216222But first, you need to let the form collection know that instead of exactly two,
217223it will receive an *unknown * number of tags. Otherwise, you'll see a
218224*"This form should not contain extra fields" * error. This is done with the
@@ -702,4 +708,5 @@ the relationship between the removed ``Tag`` and ``Task`` object.
702708.. _`@a2lix/symfony-collection` : https://github.com/a2lix/symfony-collection
703709.. _`symfony-collection` : https://github.com/ninsuo/symfony-collection
704710.. _`ArrayCollection` : https://www.doctrine-project.org/projects/doctrine-collections/en/1.6/index.html
711+ .. _`Symfony UX Demo of Form Collections` : https://ux.symfony.com/live-component/demos/form-collection-type
705712.. _`Stimulus` : https://symfony.com/doc/current/frontend/encore/simple-example.html#stimulus-symfony-ux
You can’t perform that action at this time.
0 commit comments