Skip to content
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

Document overriden form options #2397

Merged
merged 1 commit into from
Apr 24, 2013
Merged
Show file tree
Hide file tree
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
51 changes: 26 additions & 25 deletions reference/forms/types/birthday.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,31 +14,32 @@ This type is essentially the same as the :doc:`date</reference/forms/types/date>
type, but with a more appropriate default for the `years`_ option. The `years`_
option defaults to 120 years ago to the current year.

+----------------------+------------------------------------------------------------------------------------------------------------------------+
| Underlying Data Type | can be ``DateTime``, ``string``, ``timestamp``, or ``array`` (see the :ref:`input option <form-reference-date-input>`) |
+----------------------+------------------------------------------------------------------------------------------------------------------------+
| Rendered as | can be three select boxes or 1 or 3 text boxes, based on the `widget`_ option |
+----------------------+------------------------------------------------------------------------------------------------------------------------+
| Options | - `years`_ |
+----------------------+------------------------------------------------------------------------------------------------------------------------+
| Inherited | - `widget`_ |
| options | - `input`_ |
| | - `months`_ |
| | - `days`_ |
| | - `format`_ |
| | - `pattern`_ |
| | - `data_timezone`_ |
| | - `user_timezone`_ |
| | - `invalid_message`_ |
| | - `invalid_message_parameters`_ |
+----------------------+------------------------------------------------------------------------------------------------------------------------+
| Parent type | :doc:`date</reference/forms/types/date>` |
+----------------------+------------------------------------------------------------------------------------------------------------------------+
| Class | :class:`Symfony\\Component\\Form\\Extension\\Core\\Type\\BirthdayType` |
+----------------------+------------------------------------------------------------------------------------------------------------------------+

Field Options
-------------
+----------------------+-------------------------------------------------------------------------------+
| Underlying Data Type | can be ``DateTime``, ``string``, ``timestamp``, or ``array`` |
| | (see the :ref:`input option <form-reference-date-input>`) |
+----------------------+-------------------------------------------------------------------------------+
| Rendered as | can be three select boxes or 1 or 3 text boxes, based on the `widget`_ option |
+----------------------+-------------------------------------------------------------------------------+
| Overriden Options | - `years`_ |
+----------------------+-------------------------------------------------------------------------------+
| Inherited Options | - `widget`_ |
| | - `input`_ |
| | - `months`_ |
| | - `days`_ |
| | - `format`_ |
| | - `pattern`_ |
| | - `data_timezone`_ |
| | - `user_timezone`_ |
| | - `invalid_message`_ |
| | - `invalid_message_parameters`_ |
+----------------------+-------------------------------------------------------------------------------+
| Parent type | :doc:`date</reference/forms/types/date>` |
+----------------------+-------------------------------------------------------------------------------+
| Class | :class:`Symfony\\Component\\Form\\Extension\\Core\\Type\\BirthdayType` |
+----------------------+-------------------------------------------------------------------------------+

Overriden Options
-----------------

years
~~~~~
Expand Down
12 changes: 6 additions & 6 deletions reference/forms/types/choice.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ option.
| | - `expanded`_ |
| | - `preferred_choices`_ |
| | - `empty_value`_ |
| | - `empty_data`_ |
| | - `by_reference`_ |
+-------------+-----------------------------------------------------------------------------+
| Inherited | - `required`_ |
| options | - `label`_ |
| | - `read_only`_ |
| | - `error_bubbling`_ |
| | - `by_reference`_ |
| | - `empty_data`_ |
+-------------+-----------------------------------------------------------------------------+
| Parent type | :doc:`form</reference/forms/types/form>` (if expanded), ``field`` otherwise |
+-------------+-----------------------------------------------------------------------------+
Expand Down Expand Up @@ -103,10 +103,6 @@ can be created to supply the choices.

.. include:: /reference/forms/types/options/empty_value.rst.inc

.. include:: /reference/forms/types/options/empty_data.rst.inc

.. include:: /reference/forms/types/options/by_reference.rst.inc

Inherited options
-----------------

Expand All @@ -119,3 +115,7 @@ These options inherit from the :doc:`field</reference/forms/types/field>` type:
.. include:: /reference/forms/types/options/read_only.rst.inc

.. include:: /reference/forms/types/options/error_bubbling.rst.inc

.. include:: /reference/forms/types/options/by_reference.rst.inc

.. include:: /reference/forms/types/options/empty_data.rst.inc
15 changes: 15 additions & 0 deletions reference/forms/types/country.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ you should just use the ``choice`` type directly.
+-------------+-----------------------------------------------------------------------+
| Rendered as | can be various tags (see :ref:`forms-reference-choice-tags`) |
+-------------+-----------------------------------------------------------------------+
| Overriden | - `choices`_ |
| Options | |
+-------------+-----------------------------------------------------------------------+
| Inherited | - `multiple`_ |
| options | - `expanded`_ |
| | - `preferred_choices`_ |
Expand All @@ -36,6 +39,18 @@ you should just use the ``choice`` type directly.
| Class | :class:`Symfony\\Component\\Form\\Extension\\Core\\Type\\CountryType` |
+-------------+-----------------------------------------------------------------------+

Overriden Options
-----------------

choices
~~~~~~~

**default**: :method:`Symfony\\Component\\Locale\\Locale::getDisplayCountries`

The Country type defaults the choices option to the all locales which are
returned by :method:`Symfony\\Component\\Locale\\Locale::getDisplayCountries`.
It uses the default locale to determine the language.

Inherited options
-----------------

Expand Down
17 changes: 15 additions & 2 deletions reference/forms/types/csrf.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,26 @@ The ``csrf`` type is a hidden input field containing a CSRF token.
+-------------+--------------------------------------------------------------------+
| Options | - ``csrf_provider`` |
| | - ``intention`` |
| | - ``property_path`` |
+-------------+--------------------------------------------------------------------+
| Overriden | - ``property_path`` |
| Options | |
| | |
+-------------+--------------------------------------------------------------------+
| Parent type | ``hidden`` |
+-------------+--------------------------------------------------------------------+
| Class | :class:`Symfony\\Component\\Form\\Extension\\Csrf\\Type\\CsrfType` |
+-------------+--------------------------------------------------------------------+

Overriden Options
-----------------

property_path
~~~~~~~~~~~~~

**default**: ``false``

A Csrf field must not be mapped to the object, so this option defaults to ``false``.

Field Options
-------------

Expand All @@ -36,4 +49,4 @@ intention

An optional unique identifier used to generate the CSRF token.

.. include:: /reference/forms/types/options/property_path.rst.inc
.. include:: /reference/forms/types/options/property_path.rst.inc
20 changes: 19 additions & 1 deletion reference/forms/types/date.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ day, and year) or three select boxes (see the `widget_` option).
| | - `data_timezone`_ |
| | - `user_timezone`_ |
+----------------------+-----------------------------------------------------------------------------+
| Overriden Options | - `by_reference`_ |
| | - `error_bubbling`_ |
+----------------------+-----------------------------------------------------------------------------+
| Inherited | - `invalid_message`_ |
| options | - `invalid_message_parameters`_ |
+----------------------+-----------------------------------------------------------------------------+
Expand Down Expand Up @@ -113,11 +116,26 @@ Alternatively, you can specify a string to be displayed for the "blank" value::

.. include:: /reference/forms/types/options/user_timezone.rst.inc

Overriden Options
-----------------

by_reference
~~~~~~~~~~~~

**default**: ``false``

The ``DateTime`` classes are treated as immutable objects.

error_bubbling
~~~~~~~~~~~~~~

**default**: ``false``

Inherited options
-----------------

These options inherit from the :doc:`field</reference/forms/types/field>` type:

.. include:: /reference/forms/types/options/invalid_message.rst.inc

.. include:: /reference/forms/types/options/invalid_message_parameters.rst.inc
.. include:: /reference/forms/types/options/invalid_message_parameters.rst.inc
19 changes: 19 additions & 0 deletions reference/forms/types/entity.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ objects from the database.
| | - `query_builder`_ |
| | - `em`_ |
+-------------+------------------------------------------------------------------+
| Overriden | - `choices` |
| Options | - `choice_list` |
+-------------+------------------------------------------------------------------+
| Inherited | - `required`_ |
| options | - `label`_ |
| | - `multiple`_ |
Expand Down Expand Up @@ -108,6 +111,22 @@ em
If specified, the specified entity manager will be used to load the choices
instead of the default entity manager.

Overriden Options
-----------------

choices
~~~~~~~

**default**: ``null``

choice_list
~~~~~~~~~~~

**default**: all entities selected

The choices will default to all entities selected with one of the options that
are documented above.

Inherited options
-----------------

Expand Down
26 changes: 25 additions & 1 deletion reference/forms/types/form.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,28 @@
form Field Type
===============

See :class:`Symfony\\Component\\Form\\Extension\\Core\\Type\\FormType`.
See :class:`Symfony\\Component\\Form\\Extension\\Core\\Type\\FormType`.

Overriden Options
-----------------

empty_data
~~~~~~~~~~

**default**: ``array()`` / ``new $data_class()``

When no ``data_class`` option is specified, it will return an empty array.
Otherwise, it will default to a new instance of the class defined in
``data_class``.

virtual
~~~~~~~

**default**: ``false``

error_bubbling
~~~~~~~~~~~~~~

**default**: ``true``
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong. the default is $options['compound']

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stof not in 2.0


Errors of the form bubbles to the root form by default.
24 changes: 22 additions & 2 deletions reference/forms/types/hidden.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,34 @@ The hidden type represents a hidden input field.
+-------------+----------------------------------------------------------------------+
| Rendered as | ``input`` ``hidden`` field |
+-------------+----------------------------------------------------------------------+
| Inherited | - ``data`` |
| options | - ``property_path`` |
| Overriden | - `required`_ |
| Options | - `error_bubbling`_ |
+-------------+----------------------------------------------------------------------+
| Inherited | - `data`_ |
| options | - `property_path`_ |
+-------------+----------------------------------------------------------------------+
| Parent type | :doc:`field</reference/forms/types/field>` |
+-------------+----------------------------------------------------------------------+
| Class | :class:`Symfony\\Component\\Form\\Extension\\Core\\Type\\HiddenType` |
+-------------+----------------------------------------------------------------------+

Overriden Options
-----------------

required
~~~~~~~~

**default**: ``false``

Hidden fields cannot have a required attribute.

error_bubbling
~~~~~~~~~~~~~~

**default**: ``true``

Pass errors to the root form, otherwise they will not be visible.

Inherited Options
-----------------

Expand Down
15 changes: 15 additions & 0 deletions reference/forms/types/language.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ you should just use the ``choice`` type directly.
+-------------+------------------------------------------------------------------------+
| Rendered as | can be various tags (see :ref:`forms-reference-choice-tags`) |
+-------------+------------------------------------------------------------------------+
| Overriden | - `choices`_ |
| Options | |
+-------------+------------------------------------------------------------------------+
| Inherited | - `multiple`_ |
| options | - `expanded`_ |
| | - `preferred_choices`_ |
Expand All @@ -37,6 +40,18 @@ you should just use the ``choice`` type directly.
| Class | :class:`Symfony\\Component\\Form\\Extension\\Core\\Type\\LanguageType` |
+-------------+------------------------------------------------------------------------+

Overriden Options
-----------------

choices
~~~~~~~

**default**: :method:`Symfony\\Component\\Locale\\Locale::getDisplayLanguages`

The choices option defaults to all languages returned by
:method:`Symfony\\Component\\Locale\\Locale::getDisplayLanguages`. It uses the
default locale to specify the language.

Inherited Options
-----------------

Expand Down
16 changes: 16 additions & 0 deletions reference/forms/types/locale.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ you should just use the ``choice`` type directly.
+-------------+------------------------------------------------------------------------+
| Rendered as | can be various tags (see :ref:`forms-reference-choice-tags`) |
+-------------+------------------------------------------------------------------------+
| Overriden | - `choices`_ |
| Options | |
+-------------+------------------------------------------------------------------------+
| Inherited | - `multiple`_ |
| options | - `expanded`_ |
| | - `preferred_choices`_ |
Expand All @@ -38,6 +41,19 @@ you should just use the ``choice`` type directly.
| Class | :class:`Symfony\\Component\\Form\\Extension\\Core\\Type\\LanguageType` |
+-------------+------------------------------------------------------------------------+

Overriden Options
-----------------

choices
~~~~~~~

**default**: :method:`Symfony\\Component\\Locale\\Locale::getDisplayLocales`

The choices option defaults to all locales returned by
:method:`Symfony\\Component\\Locale\\Locale::getDisplayLocales`. It uses the
default locale to specify the language.


Inherited options
-----------------

Expand Down
Loading