Permalink
Browse files

bug #3433 [WIP][Reference][Form Types] Update "radio" form type (bicpi)

This PR was merged into the 2.3 branch.

Discussion
----------

[WIP][Reference][Form Types] Update "radio" form type

| Q             | A
| ------------- | ---
| Doc fix?      | yes
| New docs?     | no
| Applies to    | 2.3+
| Fixed tickets | #3410

`radio`'s parent is `checkbox`, not `form`.

I need some help regarding the task *value option should be removed from this type*:
Should it really be removed? It's because I'm able to set it and it is used in the HTML output. I'm retrieving a boolean value only when I access the submitted data via the form framework but I have also access to the raw, custom value via e.g. `$request->request->get('my_checkbox')`. So maybe it should be moved to the `inherited options` instead for the `radio` field? If yes, the wording would need an update for the `value` option and if no, why keep it for the `checkbox` field?

Commits
-------

322b21e Update&Outsource "value" option & update references
be47b90 Fix parent type doc reference
22b3d0c [Reference][Form Types] Update "radio" form type
  • Loading branch information...
weaverryan committed Jan 21, 2014
2 parents 1d1b91d + 322b21e commit ea5816f571309decd946bf30aa0b3b84fffacb9e
Showing with 22 additions and 31 deletions.
  1. +1 −11 reference/forms/types/checkbox.rst
  2. +12 −0 reference/forms/types/options/value.rst.inc
  3. +9 −20 reference/forms/types/radio.rst
@@ -42,17 +42,7 @@ Example Usage
Field Options
-------------
value
~~~~~
**type**: ``mixed`` **default**: ``1``
The value that's actually used as the value for the checkbox. This does
not affect the value that's set on your object.
.. caution::
To make a checkbox checked by default, set the `data`_ option to ``true``.
.. include:: /reference/forms/types/options/value.rst.inc
Inherited options
-----------------
@@ -0,0 +1,12 @@
value
~~~~~
**type**: ``mixed`` **default**: ``1``
The value that's actually used as the value for the checkbox or radio button.
This does not affect the value that's set on your object.
.. caution::
To make a checkbox or radio button checked by default, use the `data`_
option.
@@ -15,10 +15,9 @@ If you want to have a Boolean field, use :doc:`checkbox </reference/forms/types/
+-------------+---------------------------------------------------------------------+
| Rendered as | ``input`` ``radio`` field |
+-------------+---------------------------------------------------------------------+
| Options | - `value`_ |
+-------------+---------------------------------------------------------------------+
| Inherited | - `data`_ |
| options | - `empty_data`_ |
| Inherited | - `value`_ |
| options | - `data`_ |
| | - `empty_data`_ |
| | - `required`_ |
| | - `label`_ |
| | - `label_attr`_ |
@@ -28,29 +27,19 @@ If you want to have a Boolean field, use :doc:`checkbox </reference/forms/types/
| | - `error_mapping`_ |
| | - `mapped`_ |
+-------------+---------------------------------------------------------------------+
| Parent type | :doc:`form </reference/forms/types/form>` |
| Parent type | :doc:`checkbox </reference/forms/types/checkbox>` |
+-------------+---------------------------------------------------------------------+
| Class | :class:`Symfony\\Component\\Form\\Extension\\Core\\Type\\RadioType` |
+-------------+---------------------------------------------------------------------+
Field Options
-------------
value
~~~~~
**type**: ``mixed`` **default**: ``1``
The value that's actually used as the value for the radio button. This does
not affect the value that's set on your object.
.. caution::
To make a radio button checked by default, use the `data`_ option.
Inherited Options
-----------------
These options inherit from the :doc:`checkbox </reference/forms/types/checkbox>`
type:
.. include:: /reference/forms/types/options/value.rst.inc
These options inherit from the :doc:`form </reference/forms/types/form>` type:
.. include:: /reference/forms/types/options/data.rst.inc

0 comments on commit ea5816f

Please sign in to comment.