Skip to content

Commit 68813a0

Browse files
HeahDudewouterj
authored andcommitted
[Form] Added explicit getParent() call in types inheritance mechanism
1 parent 3fca3cb commit 68813a0

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

form/create_custom_field_type.rst

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,13 +144,23 @@ These are the most important methods that a form type class can define:
144144

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

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

156+
``getParent()``
157+
It returns a form type class name that is defined as the parent. All
158+
the other form type methods will be called with this parent type, and
159+
all its type extensions, before calling the ones defined in your custom
160+
type.
161+
By default, all classes extend the ``AbstractType`` class, which
162+
defines the ``FormType`` as the parent type.
163+
154164
Defining the Form Type
155165
~~~~~~~~~~~~~~~~~~~~~~
156166

0 commit comments

Comments
 (0)