瀏覽代碼

Merge remote-tracking branch 'jaimesuez/master'

Thomas Rabaix 14 年之前
父節點
當前提交
b4667a7452

+ 11 - 0
Resources/doc/reference/installation.rst

@@ -86,3 +86,14 @@ Once you have created an admin class, you must declare the class to use it. Like
         <argument>Sonata\NewsBundle\Entity\Post</argument>
         <argument>SonataNewsBundle:PostAdmin</argument>
     </service>
+
+Or if you're using an YML configuration file,
+
+.. code-block:: yml
+
+    services:
+       sonata.news.admin.post:
+          class: Sonata\NewsBundle\Admin\PostAdmin
+          tags:
+            - { name: sonata.admin, manager_type: orm, group: sonata_blog, label: post }
+          arguments: [null, Sonata\NewsBundle\Entity\Post, SonataNewsBundle:PostAdmin]

+ 2 - 2
Resources/doc/tutorial/creating_your_first_admin_class/defining_admin_class.rst

@@ -35,6 +35,7 @@ Secondly, register the PostAdmin class inside the DIC in your config.xml file.
 
         <tag name="sonata.admin" manager_type="orm" group="sonata_blog" label="post"/>
 
+        <argument/>
         <argument>Sonata\NewsBundle\Entity\Post</argument>
         <argument>SonataNewsBundle:PostAdmin</argument>
     </service>
@@ -48,8 +49,7 @@ Or if you're using an YML configuration file,
           class: Sonata\NewsBundle\Admin\PostAdmin
           tags:
             - { name: sonata.admin, manager_type: orm, group: sonata_blog, label: post }
-          arguments: ['', Sonata\NewsBundle\Entity\Post, SonataNewsBundle:PostAdmin]
-
+          arguments: [null, Sonata\NewsBundle\Entity\Post, SonataNewsBundle:PostAdmin]
 
 These is the minimal configuration required to display the entity inside the dashboard and
 interact with the CRUD interface. However, you need to create your admin Controller.