Kaynağa Gözat

Merge pull request #2742 from GoZOo/GoZOo-form_types-sonata_type_admin-services

Doc Form types sonata type admin services
Thomas 10 yıl önce
ebeveyn
işleme
038a6fdd81
1 değiştirilmiş dosya ile 16 ekleme ve 11 silme
  1. 16 11
      Resources/doc/reference/form_types.rst

+ 16 - 11
Resources/doc/reference/form_types.rst

@@ -348,17 +348,21 @@ that looks like this:
 
         # Acme/DemoBundle/Resources/config/admin.yml
 
-        sonata.admin.image:
-            class: Acme\DemoBundle\Admin\ImageAdmin
-            tags:
-                - { name: sonata.admin, manager_type: orm, label: "Image" }
-            arguments:
-                - ~
-                - Acme\DemoBundle\Entity\Image
-                - 'SonataAdminBundle:CRUD'
-            calls:
-                - [ setTranslationDomain, [Acme\DemoBundle]]
-
+        services:
+            sonata.admin.image:
+                class: Acme\DemoBundle\Admin\ImageAdmin
+                tags:
+                    - { name: sonata.admin, manager_type: orm, label: "Image" }
+                arguments:
+                    - ~
+                    - Acme\DemoBundle\Entity\Image
+                    - 'SonataAdminBundle:CRUD'
+                calls:
+                    - [ setTranslationDomain, [Acme\DemoBundle]]
+
+.. note::
+
+    Refer to `Getting started documentation`_ to see how to define your admin.yml file.
 
 To embed ``ImageAdmin`` within ``PageAdmin`` we just need to change the reference
 for the ``image1`` field to ``sonata_type_admin`` in our ``PageAdmin`` class:
@@ -527,3 +531,4 @@ ChoiceType
 .. _`Symfony field types`: http://symfony.com/doc/current/book/forms.html#built-in-field-types
 .. _`Symfony choice Field Type docs`: http://symfony.com/doc/current/reference/forms/types/choice.html
 .. _`Symfony PropertyPath`: http://api.symfony.com/2.0/Symfony/Component/Form/Util/PropertyPath.html
+.. _`Getting started documentation`: http://sonata-project.org/bundles/admin/master/doc/reference/getting_started.html#importing-it-in-the-main-config-yml