Skip to content

Commit 6458980

Browse files
committed
Merge pull request #302 from yositani2002/300
[翻訳]reference/forms/types/{checkbox,radio}.rst
2 parents 571a9a1 + 4570e3d commit 6458980

File tree

7 files changed

+158
-68
lines changed

7 files changed

+158
-68
lines changed

reference/forms/types/checkbox.rst

Lines changed: 65 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,88 @@
11
.. index::
22
single: Forms; Fields; checkbox
33

4-
checkbox Field Type
5-
===================
6-
7-
Creates a single input checkbox. This should always be used for a field that
8-
has a Boolean value: if the box is checked, the field will be set to true,
9-
if the box is unchecked, the value will be set to false.
10-
11-
+-------------+------------------------------------------------------------------------+
12-
| Rendered as | ``input`` ``text`` field |
13-
+-------------+------------------------------------------------------------------------+
14-
| Options | - `value`_ |
15-
+-------------+------------------------------------------------------------------------+
16-
| Inherited | - `required`_ |
17-
| options | - `label`_ |
18-
| | - `read_only`_ |
19-
| | - `error_bubbling`_ |
20-
+-------------+------------------------------------------------------------------------+
21-
| Parent type | :doc:`field</reference/forms/types/field>` |
22-
+-------------+------------------------------------------------------------------------+
23-
| Class | :class:`Symfony\\Component\\Form\\Extension\\Core\\Type\\CheckboxType` |
24-
+-------------+------------------------------------------------------------------------+
25-
26-
Example Usage
27-
-------------
4+
.. note::
5+
6+
* 対象バージョン:2.3+
7+
* 翻訳更新日:2014/05/18
8+
9+
checkbox フィールドタイプ
10+
=========================
11+
12+
単一の入力チェックボックスを作成します。これは、常にブール値を持つフィールドに使用する必要があります。
13+
チェックボックスがチェックされている場合 true に設定され、チェックボックスをオフにすると、 false に設定されます。
14+
15+
+------------------+------------------------------------------------------------------------+
16+
| 対応するデータ型 | ``input`` ``checkbox`` フィールド |
17+
+------------------+------------------------------------------------------------------------+
18+
| オプション | - `value`_ |
19+
+------------------+------------------------------------------------------------------------+
20+
| 上書きされた | - `empty_data`_ |
21+
| オプション | - `compound`_ |
22+
+------------------+------------------------------------------------------------------------+
23+
| 継承された | - `data`_ |
24+
| オプション | - `required`_ |
25+
| | - `label`_ |
26+
| | - `label_attr`_ |
27+
| | - `read_only`_ |
28+
| | - `disabled`_ |
29+
| | - `error_bubbling`_ |
30+
| | - `error_mapping`_ |
31+
| | - `mapped`_ |
32+
+------------------+------------------------------------------------------------------------+
33+
| 親タイプ | :doc:`form </reference/forms/types/form>` |
34+
+------------------+------------------------------------------------------------------------+
35+
| クラス | :class:`Symfony\\Component\\Form\\Extension\\Core\\Type\\CheckboxType` |
36+
+------------------+------------------------------------------------------------------------+
37+
38+
使用例
39+
------
2840

2941
.. code-block:: php
3042
3143
$builder->add('public', 'checkbox', array(
32-
'label' => 'Show this entry publicly?',
44+
'label' => 'このエントリーを公開しますか?',
3345
'required' => false,
3446
));
3547
36-
Field Options
37-
-------------
48+
フィールドオプション
49+
--------------------
3850

39-
value
40-
~~~~~
51+
.. include:: /reference/forms/types/options/value.rst.inc
4152

42-
**type**: ``mixed`` **default**: ``1``
53+
上書きされたオプション
54+
----------------------
4355

44-
The value that's actually used as the value for the checkbox. This does
45-
not affect the value that's set on your object.
56+
.. include:: /reference/forms/types/options/checkbox_empty_data.rst.inc
4657

47-
Inherited options
48-
-----------------
58+
.. include:: /reference/forms/types/options/checkbox_compound.rst.inc
4959

50-
These options inherit from the :doc:`field</reference/forms/types/field>` type:
60+
継承されたオプション
61+
--------------------
62+
63+
以下のオプションは :doc:`form </reference/forms/types/form>` タイプを継承しています:
64+
65+
.. include:: /reference/forms/types/options/data.rst.inc
5166

5267
.. include:: /reference/forms/types/options/required.rst.inc
5368

5469
.. include:: /reference/forms/types/options/label.rst.inc
5570

71+
.. include:: /reference/forms/types/options/label_attr.rst.inc
72+
5673
.. include:: /reference/forms/types/options/read_only.rst.inc
5774

75+
.. include:: /reference/forms/types/options/disabled.rst.inc
76+
5877
.. include:: /reference/forms/types/options/error_bubbling.rst.inc
78+
79+
.. include:: /reference/forms/types/options/error_mapping.rst.inc
80+
81+
.. include:: /reference/forms/types/options/mapped.rst.inc
82+
83+
フォーム変数
84+
------------
85+
86+
.. include:: /reference/forms/types/variables/check_or_radio_table.rst.inc
87+
88+
.. 2014/05/18 yositani2002 d49d12eaf265a5d6d32ac660c62f385d57261475
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
compound
2+
~~~~~~~~
3+
4+
**データ型**: ``boolean`` **デフォルト**: ``false``
5+
6+
このオプションは、フォームが合成物であるかを指定します。
7+
チェックボックスの場合は該当しないため、デフォルトの値を ``false`` で上書きします。
8+
9+
.. 2014/05/18 yositani2002 8d4f444c25ba45439bef046bda1b1abb89c84ed0
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
empty_data
2+
~~~~~~~~~~
3+
4+
**データ型**: ``string`` **デフォルト**: ``mixed``
5+
6+
このオプションでは、\ ``empty_value`` 選択肢が選択されたときにどのような値を返すかを決定します。
7+
チェックボックスでは、\ ``empty_data`` の値はデータトランスフォーマー(参照 :doc:`/cookbook/form/data_transformers`) によって返された値で上書きされます。
8+
9+
.. 2014/05/18 yositani2002 64602c83849b29088bfbf60b46a8fb802bcc9860

reference/forms/types/options/label_attr.rst.inc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@ label_attr
1919
array('label_attr' => array('class' => 'CUSTOM_LABEL_CLASS'))
2020
);
2121

22-
.. 2014/05/10 yositani2002 82c1db5644d1373f000e8e8dc1a3624b010faeef
22+
.. 2014/05/18 yositani2002 82c1db5644d1373f000e8e8dc1a3624b010faeef
23+
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
value
2+
~~~~~
3+
4+
**データ型**: ``mixed`` **デフォルト**: ``1``
5+
6+
実際にチェックボックスやラジオボタンの値として使われていた値です。
7+
これはオブジェクトにセットする値には影響しません。
8+
9+
.. caution::
10+
11+
デフォルトでチェックされたチェックチェックボックスやラジオボタンを作成するには、\ `data`_ オプションを使用します。
12+
13+
.. 2014/05/18 yositani2002 322b21e191c19d2c2d6a83f92762f72a5122b742

reference/forms/types/radio.rst

Lines changed: 53 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,73 @@
11
.. index::
22
single: Forms; Fields; radio
33

4-
radio Field Type
5-
================
4+
.. note::
65

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.
6+
* 対象バージョン:2.3+
7+
* 翻訳更新日:2014/05/18
108

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>`.
9+
radio フィールドタイプ
10+
======================
1411

15-
+-------------+---------------------------------------------------------------------+
16-
| Rendered as | ``input`` ``text`` field |
17-
+-------------+---------------------------------------------------------------------+
18-
| Options | - `value`_ |
19-
+-------------+---------------------------------------------------------------------+
20-
| Inherited | - `required`_ |
21-
| options | - `label`_ |
22-
| | - `read_only`_ |
23-
| | - `error_bubbling`_ |
24-
+-------------+---------------------------------------------------------------------+
25-
| Parent type | :doc:`field</reference/forms/types/field>` |
26-
+-------------+---------------------------------------------------------------------+
27-
| Class | :class:`Symfony\\Component\\Form\\Extension\\Core\\Type\\RadioType` |
28-
+-------------+---------------------------------------------------------------------+
12+
シングルラジオボタンを作成します。ラジオボタンを選択した場合は、フィールドは指定された値に設定されます。
13+
ラジオボタンはチェックをはずすことはできません - 値は、同じ名前で別のラジオボタンがチェックされるときに変更されます。
2914

30-
Field Options
31-
-------------
15+
``radio`` 型は、通常は直接使用することはありません。
16+
一般的に、 :doc:`choice </reference/forms/types/choice>` のようなほかのタイプの内部で使われます。
17+
``Boolean`` フィールドを使用したい場合は :doc:`checkbox </reference/forms/types/checkbox>` を使用してください。
3218

33-
value
34-
~~~~~
19+
+------------------+---------------------------------------------------------------------+
20+
| 対応するデータ型 | ``input`` ``radio`` フィールド |
21+
+------------------+---------------------------------------------------------------------+
22+
| 継承された | - `value`_ |
23+
| オプション | - `data`_ |
24+
| | - `empty_data`_ |
25+
| | - `required`_ |
26+
| | - `label`_ |
27+
| | - `label_attr`_ |
28+
| | - `read_only`_ |
29+
| | - `disabled`_ |
30+
| | - `error_bubbling`_ |
31+
| | - `error_mapping`_ |
32+
| | - `mapped`_ |
33+
+------------------+---------------------------------------------------------------------+
34+
| 親タイプ | :doc:`checkbox </reference/forms/types/checkbox>` |
35+
+------------------+---------------------------------------------------------------------+
36+
| クラス | :class:`Symfony\\Component\\Form\\Extension\\Core\\Type\\RadioType` |
37+
+------------------+---------------------------------------------------------------------+
3538

36-
**type**: ``mixed`` **default**: ``1``
39+
継承されたオプション
40+
--------------------
3741

38-
The value that's actually used as the value for the radio button. This does
39-
not affect the value that's set on your object.
42+
以下のオプションは :doc:`checkbox </reference/forms/types/checkbox>` タイプを継承しています:
4043

41-
Inherited Options
42-
-----------------
44+
.. include:: /reference/forms/types/options/value.rst.inc
4345

44-
These options inherit from the :doc:`field</reference/forms/types/field>` type:
46+
以下のオプションは :doc:`form </reference/forms/types/form>` タイプを継承しています:
47+
48+
.. include:: /reference/forms/types/options/data.rst.inc
49+
50+
.. include:: /reference/forms/types/options/empty_data.rst.inc
4551

4652
.. include:: /reference/forms/types/options/required.rst.inc
4753

4854
.. include:: /reference/forms/types/options/label.rst.inc
4955

56+
.. include:: /reference/forms/types/options/label_attr.rst.inc
57+
5058
.. include:: /reference/forms/types/options/read_only.rst.inc
5159

60+
.. include:: /reference/forms/types/options/disabled.rst.inc
61+
5262
.. include:: /reference/forms/types/options/error_bubbling.rst.inc
63+
64+
.. include:: /reference/forms/types/options/error_mapping.rst.inc
65+
66+
.. include:: /reference/forms/types/options/mapped.rst.inc
67+
68+
フォーム変数
69+
------------
70+
71+
.. include:: /reference/forms/types/variables/check_or_radio_table.rst.inc
72+
73+
.. 2014/05/18 yositani2002 490633b97f8c2931bc43a76dd060cfcc50da432d
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
======== ============ ============================================
2+
変数 データ型 使い方
3+
======== ============ ============================================
4+
checked ``Boolean`` 現在の入力がチェックされているかどうか。
5+
======== ============ ============================================
6+
7+
.. 2014/05/18 yositani2002 1a1497c1b296cc0711d486b1a8925d029baa8e8f

0 commit comments

Comments
 (0)