8000 minor #10387 [Form] Deprecate searchAndRenderBlock returning empty st… · symfony/symfony-docs@a3db105 · GitHub
[go: up one dir, main page]

Skip to content

Commit a3db105

Browse files
committed
minor #10387 [Form] Deprecate searchAndRenderBlock returning empty string (javiereguiluz)
This PR was squashed before being merged into the master branch (closes #10387). Discussion ---------- [Form] Deprecate searchAndRenderBlock returning empty string Fixes #10340. Commits ------- ac2ea07 [Form] Deprecate searchAndRenderBlock returning empty string
2 parents b911d15 + ac2ea07 commit a3db105

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

form/create_custom_field_type.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ link for details), create a ``shipping_widget`` block to handle this:
122122
{% spaceless %}
123123
{% if expanded %}
124124
<ul {{ block('widget_container_attributes') }}>
125-
{% for child in form %}
125+
{% for child in form if not child.rendered %}
126126
<li>
127127
{{ form_widget(child) }}
128128
{{ form_label(child) }}
@@ -136,6 +136,12 @@ link for details), create a ``shipping_widget`` block to handle this:
136136
{% endspaceless %}
137137
{% endblock %}
138138

139+
.. note::
140+
141+
Symfony 4.2 deprecated calling ``FormRenderer::searchAndRenderBlock`` for
142+
fields that have already been rendered. That's why the previous example
143+
includes the ``... if not child.rendered`` statement.
144+
139145
.. tip::
140146

141147
You can further customize the template used to render each children of the

0 commit comments

Comments
 (0)
0