Skip to content

Commit 18bfe44

Browse files
committed
Minor reword
1 parent 6b9075e commit 18bfe44

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

form/form_collections.rst

+6-2
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,8 @@ In your controller, you'll create a new form from the ``TaskType``::
157157
{
158158
$task = new Task();
159159

160-
// dummy code - add some tags to the task to play with
160+
// dummy code - add some example tags to the task
161+
// (otherwise, the template will render an empty list of tags)
161162
$tag1 = new Tag();
162163
$tag1->setName('tag1');
163164
$task->getTags()->add($tag1);
@@ -180,7 +181,7 @@ In your controller, you'll create a new form from the ``TaskType``::
180181
}
181182
}
182183

183-
In the template, we need to iterate over the existing ``TagType`` forms
184+
In the template, you can now iterate over the existing ``TagType`` forms
184185
to render them:
185186

186187
.. code-block:: html+twig
@@ -191,6 +192,7 @@ to render them:
191192

192193
{{ form_start(form) }}
193194
{{ form_row(form.description) }}
195+
194196
<h3>Tags</h3>
195197
<ul class="tags">
196198
{% for tag in form.tags %}
@@ -199,6 +201,8 @@ to render them:
199201
</ul>
200202
{{ form_end(form) }}
201203

204+
{# ... #}
205+
202206
When the user submits the form, the submitted data for the ``tags`` field are
203207
used to construct an ``ArrayCollection`` of ``Tag`` objects, which is then set
204208
on the ``tag`` field of the ``Task`` instance.

0 commit comments

Comments
 (0)