Skip to content

Commit 571a9a1

Browse files
committed
Merge pull request #299 from yositani2002/reference-forms-types-options
マークアップ修正とoptionの追加
2 parents 506a2c9 + 463a3e6 commit 571a9a1

14 files changed

+131
-25
lines changed

reference/forms/types/date.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ date フィールドタイプ
1717
このフィールドは1つのテキストボックス、または、3つのテキストボックス(月、日、年)、または、3つのセレクトボックス(参照 `widget`_ オプション)として表示することができます。
1818

1919
+----------------------+-----------------------------------------------------------------------------------------+
20-
| 対応するデータ型 | ``DateTime``,``string``, ``timestamp``, ``array`` (参照 ``input`` オプション) |
20+
| 対応するデータ型 | ``DateTime``, ``string``, ``timestamp``, ``array`` (参照 ``input`` オプション) |
2121
+----------------------+-----------------------------------------------------------------------------------------+
2222
| 対応するタグ | 単一のテキストボックス または、 3つのセレクトフィールド |
2323
+----------------------+-----------------------------------------------------------------------------------------+

reference/forms/types/datetime.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ datetime フィールドタイプ
1515
元となるデータのフォーマットは ``DateTime`` オブジェクト、 ``string`` 、 ``timestamp`` または ``array`` です。
1616

1717
+----------------------+------------------------------------------------------------------------------------------+
18-
| 対応するデータ型 | ``DateTime``, ``string``, ``timestamp``, ``array`` (参照``input`` オプション ) |
18+
| 対応するデータ型 | ``DateTime``, ``string``, ``timestamp``, ``array`` (参照 ``input`` オプション ) |
1919
+----------------------+------------------------------------------------------------------------------------------+
2020
| 対応するタグ | 単一のテキストボックス、または、3つのセレクトフィールド |
2121
+----------------------+------------------------------------------------------------------------------------------+
@@ -158,7 +158,7 @@ format
158158
+==========+============+=======================================================================================+
159159
| widget | ``mixed`` | `widget`_ オプションの値 |
160160
+----------+------------+---------------------------------------------------------------------------------------+
161-
| type | ``string`` | `widget`` が ``single_text`` で、且つ、 HTML5 が有効な場合のみ、 |
161+
| type | ``string`` | ``widget`` が ``single_text`` で、且つ、 HTML5 が有効な場合のみ、 |
162162
| | | インプットタイプ( ``datetime``, ``date`` または ``time`` )を使用できます。 |
163163
+----------+------------+---------------------------------------------------------------------------------------+
164164

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.. caution::
2+
3+
``timestamp`` を使用する場合、32bitシステムでは ``DateType`` は 1901年12月13日(金)20時45分54秒 (GMT) から 2038年1月19日(木)03時14分07秒(GMT) までの日時に限られます。
4+
これは `limitation in PHP itself <http://php.net/manual/ja/function.date.php#refsect1-function.date-changelog>`_ によるものです。
5+
6+
.. 2014/05/05 yositani2002 7dacc671f01ab8bf22f35933b06de58f563766bb
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.. tip::
2+
3+
:doc:`collection Field Type </reference/forms/types/collection>` では親フォームへエラーを渡す ``error_bubbling`` オプションはデフォルトで有効になっています。
4+
実際に発生した場所にエラーを添付したい場合は、 ``error_bubbling`` を ``false`` に設定する必要があります。
5+
6+
.. 2014/05/10 yositani2002 a0fc78fcc3598fdd2198c74ace532e244ae7da45
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
block_name
2+
~~~~~~~~~~~
3+
4+
**データ型**: ``string`` **デフォルト**: そのフォームの名前 (参照 :ref:`Knowing which block to customize <cookbook-form-customization-sidebar>`)
5+
6+
フォームタイプをレンダリングするために使用されるブロック名を上書きすることができます。
7+
同じフォームの複数のインスタンスがあり、レンダリングを個別にパーソナライズする必要がある場合に便利です。
8+
9+
.. 2014/05/10 yositani2002 23a89bb27b29d81dd87a8f522d373047ab726edf
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
cascade_validation
2+
~~~~~~~~~~~~~~~~~~
3+
4+
**データ型**: Boolean **デフォルト**: false
5+
6+
埋め込んだフォームタイプの検証を強制するためにこのオプションを ``true`` にします。
7+
例えば、 ``ProductType`` に ``CategoryType`` を埋め込んで持つ場合、 ``ProductType`` の ``cascade_validation`` を ``true`` にすることで、 検証されるべき ``CategoryType`` からもデータが発生します。
8+
9+
このオプションの代わりに、モデルの ``Valid`` 制約でプロパティに格納されている子オブジェクトの検証を強制することができます。
10+
11+
.. include:: /reference/forms/types/options/_error_bubbling_hint.rst.inc
12+
13+
.. 2014/05/10 yositani2002 163ad785f105f9dfde603df5ae7e326b0d85df53
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
constraints
2+
~~~~~~~~~~~
3+
4+
**データ型**: array または :class:`Symfony\\Component\\Validator\\Constraint` **デフォルト**: ``null``
5+
6+
特定のフィールドに1つ以上の検証制約を設定することができます。
7+
より詳しくはこちらを参照 :ref:`Adding Validation<form-option-constraints>` 。
8+
このオプションはフォーム拡張の :class:`Symfony\\Component\\Form\\Extension\\Validator\\Type\\FormTypeValidatorExtension` に追加されます。
9+
10+
.. 2014/05/10 yositani2002 d47a3c72d988f0f3f033cc92b278a51387fc1574
Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,28 @@
11
format
22
~~~~~~
33

4-
**type**: ``integer`` or ``string`` **default**: ``IntlDateFormatter::MEDIUM``
4+
**データ型**: ``integer`` または ``string`` **デフォルト**: `IntlDateFormatter::MEDIUM`_ ( `widget`_ が ``single_text`` の場合は ``yyyy-MM-dd`` )
55

6-
Option passed to the ``IntlDateFormatter`` class, used to transform user input
7-
into the proper format. This is critical when the `widget`_ option is
8-
set to ``single_text``, and will define how to transform the input. By default,
9-
the format is determined based on the current user locale; you can override
10-
it by passing the format as a string.
6+
ユーザーの入力を適切なフォーマットに変換するために使用され、オプションは ``IntlDateFormatter`` クラスに渡されます。
7+
`widget`_ オプションが ``single_text`` に設定されている場合に重要であり、ユーザがどのようにデータを入力するのかを定義します。
8+
デフォルトでは、フォーマットは現在のユーザーのロケールに基づいて決定さます。これは、 *期待するフォーマットはユーザーごとに異なる* ことを意味します。
9+
文字列として書式を渡してオーバーライドすることができます。
10+
11+
有効なフォーマットの詳細については、 `Date/Time Format Syntax`_ を参照してください。::
12+
13+
$builder->add('date_created', 'date', array(
14+
'widget' => 'single_text',
15+
// これは single_text フォーマットの実際のデフォルトです。
16+
'format' => 'yyyy-MM-dd',
17+
));
18+
19+
.. note::
20+
21+
HTML5の "date" フィールドとして表示したい場合、 ``single_text`` ウィジェットを ``yyyy-MM-dd`` ( `RFC 3339`_ のフォーマット) のフォーマットで使用しなくてはいけません。
22+
それは ``single_text`` ウィジェットを使用する場合のデフォルト値です。
23+
24+
.. _`Date/Time Format Syntax`: http://userguide.icu-project.org/formatparse/datetime#TOC-Date-Time-Format-Syntax
25+
.. _`IntlDateFormatter::MEDIUM`: http://www.php.net/manual/en/class.intldateformatter.php#intl.intldateformatter-constants
26+
.. _`RFC 3339`: http://tools.ietf.org/html/rfc3339
27+
28+
.. 2014/05/05 yositani2002 f3e5cff8694793622e3fc184a4b263d857ad4456
Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
input
22
~~~~~
33

4-
**type**: ``string`` **default**: ``datetime``
4+
**データ型**: ``string`` **デフォルト**: ``datetime``
55

6-
The format of the *input* data - i.e. the format that the date is stored on
7-
your underlying object. Valid values are:
6+
*input* データのフォーマット、すなわち、対応するオブジェクトに保存される日付のフォーマットの有効な値は次のとおりです。:
87

9-
* ``string`` (e.g. ``2011-06-05``)
10-
* ``datetime`` (a ``DateTime`` object)
11-
* ``array`` (e.g. ``array('year' => 2011, 'month' => 06, 'day' => 05)``)
12-
* ``timestamp`` (e.g. ``1307232000``)
8+
* ``string`` ( ``2011-06-05``)
9+
* ``datetime`` (単一の ``DateTime`` オブジェクト)
10+
* ``array`` ( ``array('year' => 2011, 'month' => 06, 'day' => 05)```)
11+
* ``timestamp`` ( ``1307276100``)
1312

14-
The value that comes back from the form will also be normalized back into
15-
this format.
13+
フォームから戻って来る値も、この形式に戻して正規化されます。
14+
15+
.. include:: /reference/forms/types/options/_date_limitation.rst.inc
16+
17+
.. 2014/05/05 yositani2002 7dacc671f01ab8bf22f35933b06de58f563766bb
Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
widget
22
~~~~~~
33

4-
**type**: ``string`` **default**: ``choice``
4+
**データ型**: ``string`` **デフォルト**: ``choice``
55

6+
フィールドの表示の基本的な方法です。次のいずれかになります。
67
The basic way in which this field should be rendered. Can be one of the following:
78

8-
* ``choice``: renders three select inputs. The order of the selects is defined
9-
in the `pattern`_ option.
9+
* ``choice``: 3つの選択フォームを表示します。選択の順序は、`format`_ オプションで定義されています。
1010

11-
* ``text``: renders a three field input of type text (month, day, year).
11+
* ``text``: 3つの ``text`` タイプの入力フィールド(月、日、年)をレンダリングします。
1212

13-
* ``single_text``: renders a single input of type text. User's input is validated
14-
based on the `format`_ option.
13+
* ``single_text``: ``date`` タイプの単一の入力フォームをレンダリングします。ユーザーの入力は `format`_ オプションに基づいて検証されます。
14+
15+
.. 2014/05/05 yositani2002 8d4f444c25ba45439bef046bda1b1abb89c84ed0
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
label_attr
2+
~~~~~~~~~~
3+
4+
**データ型**: ``array`` **デフォルト値**: ``array()``
5+
6+
フィールドのラベルを表示する際、 ``<label>`` 要素に html 属性を設定します。それは HTML 属性をキーとした連想配列です。この属性は直接テンプレートの中に設定することも出来ます。:
7+
8+
.. configuration-block::
9+
10+
.. code-block:: jinja
11+
12+
{{ form_label(form.name, 'あなたのお名前', {'label_attr': {'class': 'CUSTOM_LABEL_CLASS'}}) }}
13+
14+
.. code-block:: php
15+
16+
echo $view['form']->label(
17+
$form['name'],
18+
'あなたのお名前',
19+
array('label_attr' => array('class' => 'CUSTOM_LABEL_CLASS'))
20+
);
21+
22+
.. 2014/05/10 yositani2002 82c1db5644d1373f000e8e8dc1a3624b010faeef
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
translation_domain
2+
~~~~~~~~~~~~~~~~~~
3+
4+
**データ型**: ``string`` **デフォルト**: ``messages``
5+
6+
このフィールドのラベルまたはオプションの表示に使用されるに翻訳ドメインです。
7+
8+
.. 2014/05/10 yositani2002 d47a3c72d988f0f3f033cc92b278a51387fc1574
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.. versionadded:: 2.2
2+
``with_minutes`` オプションは Symfony 2.2 で追加されました。
3+
4+
with_minutes
5+
~~~~~~~~~~~~
6+
7+
**データ型**: ``Boolean`` **デフォルト**: ``true``
8+
9+
分を入力に含めるかどうか。これは分を取得する追加の入力フォームを出力します。
10+
11+
.. 2014/04/26 yositani2002 1e88b9decb626e91f99990b3440cbaa96c46cbda

reference/forms/types/time.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ time フィールドタイプ
1515
元となるデータは ``DateTime`` オブジェクト、 ``string`` 、 ``timestamp`` または ``array`` として保存することが出来ます。
1616

1717
+----------------------+--------------------------------------------------------------------------------+
18-
| 対応するデータ型 | ``DateTime``, ``string``, ``timestamp``, ``array`` (参照``input`` オプション ) |
18+
| 対応するデータ型 | ``DateTime``, ``string``, ``timestamp``, ``array`` (参照 ``input`` オプション )|
1919
+----------------------+--------------------------------------------------------------------------------+
2020
| 対応するタグ | 様々なタグとして利用可能 (下記参照) |
2121
+----------------------+--------------------------------------------------------------------------------+

0 commit comments

Comments
 (0)