Jelajahi Sumber

Merge pull request #4626 from lelledaniele/patch-1

Added a note about sonata_type_model requisite
Jordi Sala Morales 7 tahun lalu
induk
melakukan
28f45a4c91
1 mengubah file dengan 10 tambahan dan 5 penghapusan
  1. 10 5
      Resources/doc/reference/form_types.rst

+ 10 - 5
Resources/doc/reference/form_types.rst

@@ -40,15 +40,20 @@ All we need to do now is add a reference for this field in our ``PageAdmin`` cla
         }
         }
     }
     }
 
 
-Since the ``image1`` field refers to a related entity we do not need to specify
-any options. Sonata will calculate that the linked class is of type ``Image`` and,
-by default, retrieve a list of all existing Images to display as choices in the
-selector.
-
 Note that the third parameter to ``FormMapper::add()`` is optional so
 Note that the third parameter to ``FormMapper::add()`` is optional so
 there is no need to pass in an empty array, it is shown here just to demonstrate
 there is no need to pass in an empty array, it is shown here just to demonstrate
 where the options go when you want to use them.
 where the options go when you want to use them.
 
 
+Since the ``image1`` field refers to a related entity we do not need to specify
+any options. Sonata will calculate that the linked admin class is of type ``Image`` and,
+by default, use the ``ImageAdmin`` class to retrieve a list of all existing Images
+to display as choices in the selector.
+
+.. tip::
+
+    You need to create ``ImageAdmin`` class in this case to use ``sonata_type_model`` type.
+    :ref:`You can also use <form_types_fielddescription_options>` use the ``admin_code`` parameter.
+
 The available options are:
 The available options are:
 
 
 property
 property