File tree 1 file changed +7
-0
lines changed
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
213
213
add as many tag forms as they need directly in the browser. This requires a bit
214
214
of JavaScript code.
215
215
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
+
216
222
But first, you need to let the form collection know that instead of exactly two,
217
223
it will receive an *unknown * number of tags. Otherwise, you'll see a
218
224
*"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.
702
708
.. _`@a2lix/symfony-collection` : https://github.com/a2lix/symfony-collection
703
709
.. _`symfony-collection` : https://github.com/ninsuo/symfony-collection
704
710
.. _`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
705
712
.. _`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