@@ -312,10 +312,36 @@ names.
312
312
Fragment Naming for Collections
313
313
...............................
314
314
315
- When using a :doc: `collection of forms </form/form_collections >`, the fragment
316
- of each collection item follows a predefined pattern. For example, consider the
317
- following complex example where a ``TaskManagerType `` has a collection of
318
- ``TaskListType `` which in turn has a collection of ``TaskType ``::
315
+ When using a :doc: `collection of forms </form/form_collections >`, you have
316
+ several ways of customizing the collection and each of its entries. First,
317
+ use the following blocks to customize each part of all form collections:
318
+
319
+ .. code-block :: twig
320
+
321
+ {% block collection_row %} ... {% endblock %}
322
+ {% block collection_label %} ... {% endblock %}
323
+ {% block collection_widget %} ... {% endblock %}
324
+ {% block collection_help %} ... {% endblock %}
325
+ {% block collection_errors %} ... {% endblock %}
326
+
327
+ You can also customize each entry of all collections with the following blocks:
328
+
329
+ .. code-block :: twig
330
+
331
+ {% block collection_entry_row %} ... {% endblock %}
332
+ {% block collection_entry_label %} ... {% endblock %}
333
+ {% block collection_entry_widget %} ... {% endblock %}
334
+ {% block collection_entry_help %} ... {% endblock %}
335
+ {% block collection_entry_errors %} ... {% endblock %}
336
+
337
+ .. versionadded :: 5.1
338
+
339
+ The ``collection_entry_* `` blocks were introduced in Symfony 5.1.
340
+
341
+ Finally, you can customize specific form collections instead of all of them.
342
+ For example, consider the following complex example where a ``TaskManagerType ``
343
+ has a collection of ``TaskListType `` which in turn has a collection of
344
+ ``TaskType ``::
319
345
320
346
class TaskManagerType extends AbstractType
321
347
{
0 commit comments