Skip to content

Commit 385e4eb

Browse files
committed
Merge pull request #290 from yositani2002/reference-forms-types-country
[翻訳]reference/forms/types/options/{attr,data}.rst.inc
2 parents 6f27182 + 279a76b commit 385e4eb

File tree

3 files changed

+19
-6
lines changed

3 files changed

+19
-6
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
attr
2+
~~~~
3+
4+
**データ型**: array **デフォルト値**: Empty array
5+
6+
HTML フィールドの表現に追加属性を加えたい場合、\ ``attr`` オプションを使うことが出来ます。これは HTML 属性をキーとした連想配列です。ウィジェットにカスタムクラスを設定する必要があるときに便利です。::
7+
8+
$builder->add('body', 'textarea', array(
9+
'attr' => array('class' => 'tinymce'),
10+
));
11+
12+
.. 2014/03/07 yositani2002 47553456070b494377c96097c01ec3138ec1090b
Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
data
22
~~~~
33

4-
**type**: mixed **default**: Defaults to field of the underlying object (if there is one)
4+
**データ型**: mixed **デフォルト**: 対応するオブジェクトのフィールド(一つであれば)
55

6-
When you create a form, each field initially displays the value of the
7-
corresponding property of the form's domain object (if an object is bound
8-
to the form). If you want to override the initial value for the form or just
9-
and individual field, you can set it in the data option::
6+
フォームを作成したとき、各フィールドに表示する初期値は、フォームのドメインオブジェクトの対応するプロパティの値です(オブジェクトがフォームにバインドされている場合)。もしフォーム、または、単に個々のフィールドの初期値を上書きしたい場合は、\ ``data`` オプションで設定することが出来ます。::
107

118
$builder->add('token', 'hidden', array(
129
'data' => 'abcdef',
1310
));
1411

12+
.. note::
13+
フォームのフィールドのデフォルト値は、直接データ構造(例えば、エンティティまたは配列)から取得されます。
14+
``data`` オプションはこのデフォルト値を上書きします。
1515

16+
.. 2014/03/07 yositani2002 08d95b27e7d210b16889a22b2d6d8ba11820ae4a

reference/forms/types/timezone.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ choice_list
4949

5050
**デフォルト**: :class:`Symfony\\Component\\Form\\Extension\\Core\\ChoiceList\\TimezoneChoiceList`
5151

52-
``Timezone`` タイプのデフォルトの ``choice_list `` は :phpmethod:`DateTimeZone::listIdentifiers` で返されるすべてのタイムゾーンとなり、大陸別に分類します。
52+
``Timezone`` タイプのデフォルトの ``choice_list`` は :phpmethod:`DateTimeZone::listIdentifiers` で返されるすべてのタイムゾーンとなり、大陸別に分類します。
5353

5454
継承されたオプション
5555
--------------------

0 commit comments

Comments
 (0)