Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cb79c95

Browse files
committed
Merge pull request symfony#1479 from nomack84/form_fixes
[Form]Some form fixes
2 parents d590450 + 68da45b commit cb79c95

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

book/forms.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1550,7 +1550,7 @@ but here's a short example::
15501550
;
15511551

15521552
Now, when you call `$form->bindRequest($request)`, the constraints setup here are run
1553-
against your form's data. If you're using a form class, override the ``getDefaultOptions``
1553+
against your form's data. If you're using a form class, override the ``setDefaultOptions()``
15541554
method to specify the option::
15551555

15561556
namespace Acme\TaskBundle\Form\Type;

cookbook/form/create_custom_field_type.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,17 +70,17 @@ important:
7070
set) the ``multiple`` attribute on the ``select`` field. See `Creating a Template for the Field`_
7171
for more details.
7272

73-
* ``getDefaultOptions()`` - This defines options for your form type that
73+
* ``setDefaultOptions()`` - This defines options for your form type that
7474
can be used in ``buildForm()`` and ``buildView()``. There are a lot of
75-
options common to all fields (see `FieldType`_), but you can create any
75+
options common to all fields (see `FormType`_), but you can create any
7676
others that you need here.
7777

7878
.. tip::
7979

8080
If you're creating a field that consists of many fields, then be sure
8181
to set your "parent" type as ``form`` or something that extends ``form``.
8282
Also, if you need to modify the "view" of any of your child types from
83-
your parent type, use the ``buildViewBottomUp()`` method.
83+
your parent type, use the ``finishView()`` method.
8484

8585
The ``getName()`` method returns an identifier which should be unique in
8686
your application. This is used in various places, such as when customizing

cookbook/form/use_virtuals_forms.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ But we absolutely want to have a dedicated form type to deal with location (reme
113113

114114
The ``virtual`` form field option is the solution.
115115

116-
We can set the option ``'virtual' => true`` in the ``getDefaultOptions`` method
116+
We can set the option ``'virtual' => true`` in the ``setDefaultOptions()`` method
117117
of ``LocationType`` and directly start using it in the two original form types.
118118

119119
Look at the result::

0 commit comments

Comments
 (0)