Skip to content

マークアップ修正 #293

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 24, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 35 additions & 33 deletions reference/forms/twig_reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -271,67 +271,69 @@ Form 変数リファレンス
</label>

.. versionadded:: 2.3
The ``method`` and ``action`` variables were introduced in Symfony 2.3.
``method`` ``action`` は Symfony2.3 で追加されました。

.. versionadded:: 2.4
``submitted`` 変数は Symfony2.4 で追加されました。

+------------------------+-------------------------------------------------------------------------------------+
| 変数名 | 使い方 |
| 変数名 | 使い方 |
+========================+=====================================================================================+
| ``form`` | 現在の``FormView`` インスタンス |
| ``form`` | 現在の ``FormView`` インスタンス |
+------------------------+-------------------------------------------------------------------------------------+
| ``id`` | 出力される ``id`` HTML属性 |
| ``id`` | 出力される ``id`` HTML属性 |
+------------------------+-------------------------------------------------------------------------------------+
| ``name`` | フィールド名 (例えば ``title``) ただし ``name`` HTML属性ではありません。 |
| | ``name`` HTML属性は ``full_name`` です。 |
| ``name`` | フィールド名 (例えば ``title``) ただし ``name`` HTML属性ではありません。 |
| | ``name`` HTML属性は ``full_name`` です。 |
+------------------------+-------------------------------------------------------------------------------------+
| ``full_name`` | 出力される ``name`` HTML属性 |
| ``full_name`` | 出力される ``name`` HTML属性 |
+------------------------+-------------------------------------------------------------------------------------+
| ``errors`` | 個別のフィールドについての全てのエラーの配列d |
| | (たとえば ``form.title.errors`` のように) |
| | ``form.errors`` はフォームが正しいかどうかを調べるのに利用することはできません。|
| | グローバルなエラーしか返さないので、 個別のフィールドにはエラーがある可能性があるからです。
| | 代わりに ``valid`` を使ってください。 |
| ``errors`` | 個別のフィールドについての全てのエラーの配列d |
| | (たとえば ``form.title.errors`` のように) |
| | ``form.errors`` はフォームが正しいかどうかを調べるのに利用することはできません。 |
| | グローバルなエラーしか返さないので、 個別のフィールドにはエラーがある可能性がある |
| | からです。代わりに ``valid`` を使ってください。 |
+------------------------+-------------------------------------------------------------------------------------+
| ``submitted`` | フォームが送信されたかどうか ``true`` 又は ``false`` で返します。|
| ``submitted`` | フォームが送信されたかどうか ``true`` 又は ``false`` で返します。 |
+------------------------+-------------------------------------------------------------------------------------+
| ``valid`` | フォーム全体にエラーが無いかどうか ``true`` 又は ``false`` で返します。 |
| ``valid`` | フォーム全体にエラーが無いかどうか ``true`` 又は ``false`` で返します。 |
+------------------------+-------------------------------------------------------------------------------------+
| ``value`` | 出力時に利用される値(大抵の場合は ``value`` HTML属性) |
| ``value`` | 出力時に利用される値(大抵の場合は ``value`` HTML属性) |
+------------------------+-------------------------------------------------------------------------------------+
| ``read_only`` | ``true`` であれば ``readonly="readonly"`` がフィールドに追加されます。
| ``read_only`` | ``true`` であれば ``readonly="readonly"`` がフィールドに追加されます。 |
+------------------------+-------------------------------------------------------------------------------------+
| ``disabled`` | ``true`` であれば ``disabled="disabled"`` がフィールドに追加されます。 |
| ``disabled`` | ``true`` であれば ``disabled="disabled"`` がフィールドに追加されます。 |
+------------------------+-------------------------------------------------------------------------------------+
| ``required`` | ``true`` であれば ``required`` 属性がフィールドに追加され、HTML5のバリデーションを有効にします。 |
| | さらに、 ``required`` クラスがラベルに追加されます。 |
| ``required`` | ``true`` であれば ``required`` 属性がフィールドに追加され、HTML5のバリデーションを |
| | 有効にします。さらに、 ``required`` クラスがラベルに追加されます。 |
+------------------------+-------------------------------------------------------------------------------------+
| ``max_length`` | エレメントに ``maxlength`` 属性を追加します。(2.5で廃止され、3.0で削除予定です。代わりに ``attr[maxlength]`` を使ってください) |
| ``max_length`` | エレメントに ``maxlength`` 属性を追加します。(2.5で廃止され、3.0で削除予定です。 |
| | 代わりに ``attr[maxlength]`` を使ってください) |
+------------------------+-------------------------------------------------------------------------------------+
| ``pattern`` | エレメントに ``pattern`` 属性を追加します。(2.5で廃止され、3.0で削除予定です。代わりに ``attr[pattern]`` を使ってください) |
| ``pattern`` | エレメントに ``pattern`` 属性を追加します。(2.5で廃止され、3.0で削除予定です。 |
| | 代わりに ``attr[pattern]`` を使ってください) |
+------------------------+-------------------------------------------------------------------------------------+
| ``label`` | 出力されるラベル文字列。 |
| ``label`` | 出力されるラベル文字列。 |
+------------------------+-------------------------------------------------------------------------------------+
| ``multipart`` | もし ``true`` なら、 ``form_enctype`` は ``enctype="multipart/form-data"`` を出力します。 |
| | 親のフォームだけに適用されます。 |
| ``multipart`` | もし ``true`` なら、 ``form_enctype`` は ``enctype="multipart/form-data"`` を出力 |
| | します。親のフォームだけに適用されます。 |
+------------------------+-------------------------------------------------------------------------------------+
| ``attr`` | フィールドに HTML 属性として出力される key-value 配列。 |
| ``attr`` | フィールドに HTML 属性として出力される key-value 配列。 |
+------------------------+-------------------------------------------------------------------------------------+
| ``compound`` | フィールドが実際は子フィールドを保持しているかどうか。|
| | (例えば ``choice`` フィールドがあるときに、それがチェックボックスの集合で成り立っているかどうか。 |
| ``compound`` | フィールドが実際は子フィールドを保持しているかどうか。(例えば ``choice`` フィールド |
| | があるときに、それがチェックボックスの集合で成り立っているかどうか。 |
+------------------------+-------------------------------------------------------------------------------------+
| ``block_prefixes`` | 親タイプ全ての名前の配列 |
| ``block_prefixes`` | 親タイプ全ての名前の配列 |
+------------------------+-------------------------------------------------------------------------------------+
| ``translation_domain`` | 現在のフォームの翻訳ドメイン |
| ``translation_domain`` | 現在のフォームの翻訳ドメイン |
+------------------------+-------------------------------------------------------------------------------------+
| ``cache_key`` | キャッシュで利用される一意なキー |
| ``cache_key`` | キャッシュで利用される一意なキー |
+------------------------+-------------------------------------------------------------------------------------+
| ``data`` | タイプの変換された(ノーマライズされた)データ |
| ``data`` | タイプの変換された(ノーマライズされた)データ |
+------------------------+-------------------------------------------------------------------------------------+
| ``method`` | 現在のフォームのメソッド(GET, POSTなど) |
| ``method`` | 現在のフォームのメソッド(GET, POSTなど) |
+------------------------+-------------------------------------------------------------------------------------+
| ``action`` | 現在のフォームのアクション |
| ``action`` | 現在のフォームのアクション |
+------------------------+-------------------------------------------------------------------------------------+

.. _`form_div_layout.html.twig`: https://github.com/symfony/symfony/blob/master/src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig
Expand Down
Loading