瀏覽代碼

Enhancing reading of the form type chapter

Baptiste "Talus" Clavie 13 年之前
父節點
當前提交
5ca2e1c5ee
共有 1 個文件被更改,包括 29 次插入13 次删除
  1. 29 13
      Resources/doc/reference/form_types.rst

+ 29 - 13
Resources/doc/reference/form_types.rst

@@ -9,17 +9,22 @@ The bundle come with different form types to handle model values:
 sonata_type_model
 ^^^^^^^^^^^^^^^^^
 
-The ``Model Type`` allows you to choose an existing model or create new ones. This type doesn't allow to directly edit the selected model.
+The ``Model Type`` allows you to choose an existing model or create new ones. 
+This type doesn't allow to directly edit the selected model.
 
 sonata_type_admin
 ^^^^^^^^^^^^^^^^^
 
-The ``Admin Type`` will delegate the form construction for this model to its related admin class. This type is useful to cascade edition or creation of linked models.
+The ``Admin Type`` will delegate the form construction for this model to its 
+related admin class. This type is useful to cascade edition or creation of 
+linked models.
 
 sonata_type_collection
 ^^^^^^^^^^^^^^^^^^^^^^
 
-The ``Collection Type`` is meant to handle creation and edition of model collections. Rows can be added and deleted, and your model abstraction layer may allow you to edit fields inline.
+The ``Collection Type`` is meant to handle creation and edition of model 
+collections. Rows can be added and deleted, and your model abstraction layer may
+allow you to edit fields inline.
 
 Type configuration
 ^^^^^^^^^^^^^^^^^^
@@ -30,27 +35,36 @@ todo
 Field configuration
 ^^^^^^^^^^^^^^^^^^^
 
-- ``admin_code``: Force for any field involving a model the admin class used to handle it (useful for inline editing with ``sonata_type_admin``). The expected value here is the admin service name, not the class name. If not defined, the default admin class for the model type will be used (even if you didn't define any admin for the model type).
+- ``admin_code``: Force for any field involving a model the admin class used to 
+    handle it (useful for inline editing with ``sonata_type_admin``). The 
+    expected value here is the admin service name, not the class name. If not 
+    defined, the default admin class for the model type will be used (even if 
+    you didn't define any admin for the model type).
 
-Other specific field configuration options are detailed in the related abstraction layer documentation.
+Other specific field configuration options are detailed in the related 
+abstraction layer documentation.
 
 Other form types
 ----------------
 
-The bundle comes with some handy form types which are available from outside the scope of the ``SonataAdminBundle``::
+The bundle comes with some handy form types which are available from outside the
+scope of the ``SonataAdminBundle``:
 
 sonata_type_immutable_array
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-The ``Immutable Array`` allows you to edit an array property by defining a type per key.
+The ``Immutable Array`` allows you to edit an array property by defining a type 
+per key.
+
+The type has a ``keys`` parameter which contains the definition for each key. 
+A definition is an array with 3 options :
 
-The type has a ``keys`` parameter which contains the definition for each key. A definition is an array with 3 options :
 * key name
 * type : a type name or a ``FormType`` instance
 * related type parameters : please refer to the related form documentation.
 
-Let's say a ``Page`` have options property with some fixed key-pair values, each value has a different type : integer,
-url, or string for instance.
+Let's say a ``Page`` have options property with some fixed key-pair values, each
+value has a different type : integer, url, or string for instance.
 
 .. code-block:: php
 
@@ -89,16 +103,18 @@ Now, the property can be edited by setting a type for each type
 sonata_type_boolean
 ^^^^^^^^^^^^^^^^^^^
 
-The ``boolean`` type is a specialized ``ChoiceType`` where the choices list is locked to 'yes' and 'no'.
+The ``boolean`` type is a specialized ``ChoiceType`` where the choices list is 
+locked to 'yes' and 'no'.
 
 
 sonata_type_translatable_choice
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-The translatable type is a specialized ``ChoiceType`` where the choices values are translated with the Symfony
-Translator component.
+The translatable type is a specialized ``ChoiceType`` where the choices values 
+are translated with the Symfony Translator component.
 
 The type has one extra parameter :
+
  * ``catalogue`` : the catalogue name to translate the value