Skip to content

[Form] Deprecate searchAndRenderBlock returning empty string #10387

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion form/create_custom_field_type.rst
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ link for details), create a ``shipping_widget`` block to handle this:
{% spaceless %}
{% if expanded %}
<ul {{ block('widget_container_attributes') }}>
{% for child in form %}
{% for child in form if not child.rendered %}
<li>
{{ form_widget(child) }}
{{ form_label(child) }}
Expand All @@ -136,6 +136,12 @@ link for details), create a ``shipping_widget`` block to handle this:
{% endspaceless %}
{% endblock %}

.. note::

Symfony 4.2 deprecated calling ``FormRenderer::searchAndRenderBlock`` for
fields that have already been rendered. That's why the previous example
includes the ``... if not child.rendered`` statement.

.. tip::

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