Skip to content

[Form] Added explicit getParent() call in types inheritance mechanism #14588

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 2 commits into from
Nov 23, 2020
Merged
Changes from 1 commit
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
12 changes: 11 additions & 1 deletion form/create_custom_field_type.rst
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,23 @@ These are the most important methods that a form type class can define:

``configureOptions()``
It defines the options configurable when using the form type, which are also
the options that can be used in ``buildForm()`` and ``buildView()`` methods.
the options that can be used in ``buildForm()`` and ``buildView()``
methods. Options are inherited from parent types and parent type
extensions, but you can create any custom option you need.

``finishView()``
When creating a form type that consists of many fields, this method allows
to modify the "view" of any of those fields. For any other use case, it's
recommended to use instead the ``buildView()`` method.

``getParent()``
It returns a form type class name that is defined as the parent. All
the other form type methods will be called with this parent type, and
all its type extensions, before calling the ones defined in your custom
type.
By default, all classes extend the ``AbstractType`` class, which
defines the ``FormType`` as the parent type.

Defining the Form Type
~~~~~~~~~~~~~~~~~~~~~~

Expand Down