Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

[Form]Some form fixes #1479

Merged
merged 2 commits into from

2 participants

@nomack84

Here I remove the last getDefaultOptions remaining on the docs (at least all I found) and also rename the old buildViewBottomUp to finishView.

@weaverryan weaverryan merged commit cb79c95 into from
@weaverryan
Collaborator

Love it!

Thanks very much Mario - keep up the good work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
View
4 book/forms.rst
@@ -390,7 +390,7 @@ you'll need to specify which validation group(s) your form should use::
;
If you're creating :ref:`form classes<book-form-creating-form-classes>` (a
-good practice), then you'll need to add the following to the ``getDefaultOptions()``
+good practice), then you'll need to add the following to the ``setDefaultOptions()``
method::
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
@@ -1550,7 +1550,7 @@ but here's a short example::
;
Now, when you call `$form->bindRequest($request)`, the constraints setup here are run
-against your form's data. If you're using a form class, override the ``getDefaultOptions``
+against your form's data. If you're using a form class, override the ``setDefaultOptions()``
method to specify the option::
namespace Acme\TaskBundle\Form\Type;
View
6 cookbook/form/create_custom_field_type.rst
@@ -70,9 +70,9 @@ important:
set) the ``multiple`` attribute on the ``select`` field. See `Creating a Template for the Field`_
for more details.
-* ``getDefaultOptions()`` - This defines options for your form type that
+* ``setDefaultOptions()`` - This defines options for your form type that
can be used in ``buildForm()`` and ``buildView()``. There are a lot of
- options common to all fields (see `FieldType`_), but you can create any
+ options common to all fields (see `FormType`_), but you can create any
others that you need here.
.. tip::
@@ -80,7 +80,7 @@ important:
If you're creating a field that consists of many fields, then be sure
to set your "parent" type as ``form`` or something that extends ``form``.
Also, if you need to modify the "view" of any of your child types from
- your parent type, use the ``buildViewBottomUp()`` method.
+ your parent type, use the ``finishView()`` method.
The ``getName()`` method returns an identifier which should be unique in
your application. This is used in various places, such as when customizing
View
2  cookbook/form/use_virtuals_forms.rst
@@ -113,7 +113,7 @@ But we absolutely want to have a dedicated form type to deal with location (reme
The ``virtual`` form field option is the solution.
-We can set the option ``'virtual' => true`` in the ``getDefaultOptions`` method
+We can set the option ``'virtual' => true`` in the ``setDefaultOptions()`` method
of ``LocationType`` and directly start using it in the two original form types.
Look at the result::
Something went wrong with that request. Please try again.