Skip to content

Commit ca151ce

Browse files
committed
Tweaks
1 parent e01ba27 commit ca151ce

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

form/form_collections.rst

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
11
.. index::
22
single: Form; Embed collection of forms
33

4-
Edit Related Entities in a Single Form
5-
======================================
4+
How to Embed a Collection of Forms
5+
==================================
66

7-
To edit associated entities in the same form, Symfony has the concept of
8-
Form "Collections". Think of it as a series of sub-forms, embedded into
9-
the main form.
7+
Symfony Forms can embed a collection of many other forms, which is useful to
8+
edit related entities in a single form. In this article, you'll create a form to
9+
edit a ``Task`` class and, right inside the same form, you'll be able to edit,
10+
create and remove many ``Tag`` objects related to that Task.
1011

11-
The example used in this article is a ``Task`` entity that relates to
12-
a ``Tag`` entitiy. The goal is to create a single form for tasks, that
13-
also allows to edit/create/remove many tags associated with that task.
14-
15-
Here's the ``Task`` and the ``Tag`` entity::
12+
Let's start by creating a ``Task`` entity::
1613

1714
// src/Entity/Task.php
1815
namespace App\Entity;
@@ -48,8 +45,11 @@ Here's the ``Task`` and the ``Tag`` entity::
4845

4946
.. note::
5047

51-
The `ArrayCollection`_ is specific to Doctrine and is basically the
52-
same as using an ``array``.
48+
The `ArrayCollection`_ is specific to Doctrine and is similar to a PHP array
49+
but provides many utility methods.
50+
51+
Now, create a ``Tag`` class. As you saw above, a ``Task`` can have many ``Tag``
52+
objects::
5353

5454
.. code-block:: php
5555

0 commit comments

Comments
 (0)