Skip to content

Commit 6a87e04

Browse files
committed
[reference][forms] Adding the radio type
1 parent 037a221 commit 6a87e04

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

reference/forms/types/radio.rst

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,32 @@
44
``radio`` Field Type
55
====================
66

7-
See :class:`Symfony\\Component\\Form\\Type\\RadioType`.
7+
Creates a single radio button. This should always be used for a field that
8+
has a Boolean value: if the radio button is selected, the field will be set
9+
to true, if the button is not selected, the value will be set to false.
10+
11+
The ``radio`` type isn't usually used directly. More commonly it's used
12+
internally by other types such as :doc:`choice</reference/forms/types/choice>`.
13+
If you want to have a Boolean field, use :doc:`checkbox</reference/forms/types/checkbox>`.
14+
15+
============ ======
16+
Rendered as ``input`` ``text`` field
17+
Options ``value``, ``required``, ``label``, ``read_only``, ``error_bubbling``
18+
Parent type ``field``
19+
Class :class:`Symfony\\Component\\Form\\Type\\RadioType`
20+
============ ======
21+
22+
Options
23+
-------
24+
25+
* ``value`` [type: mixed, default: 1]
26+
The value that's actually used as the value for the radio button. This does
27+
not affect the value that's set on your object.
28+
29+
.. include:: /reference/forms/types/options/required.rst.inc
30+
31+
.. include:: /reference/forms/types/options/label.rst.inc
32+
33+
.. include:: /reference/forms/types/options/read_only.rst.inc
34+
35+
.. include:: /reference/forms/types/options/error_bubbling.rst.inc

0 commit comments

Comments
 (0)