Skip to content

Improved the explanation of the block_name form option #11018

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

Merged
merged 1 commit into from
Feb 21, 2019
Merged
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
11 changes: 8 additions & 3 deletions reference/forms/types/options/block_name.rst.inc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ block_name
**type**: ``string`` **default**: the form's name (see :ref:`Knowing which
block to customize <form-customization-sidebar>`)

Allows you to override the block name used to render the form type.
Useful for example if you have multiple instances of the same form and you
need to personalize the rendering of the forms individually.
Allows you to add a custom block name to the ones used by default to render the
form type. Useful for example if you have multiple instances of the same form
and you need to personalize the rendering of the forms individually.

If you set for example this option to ``my_custom_name`` and the field is of
type ``text``, Symfony will use the following names (and in this order) to find
the block used to render the widget of the field: ``_my_custom_name_widget``,
``text_widget`` and ``form_widget``.