Parcourir la source

Moved route config to installation docs

core23 il y a 7 ans
Parent
commit
cd6745cf7f

+ 38 - 1
Resources/doc/getting_started/installation.rst

@@ -158,7 +158,44 @@ The translator service is required by SonataAdmin to display all labels properly
     framework:
     framework:
         translator: { fallbacks: [en] }
         translator: { fallbacks: [en] }
 
 
-Step 6: Preparing your Environment
+Step 6: Define routes
+---------------------
+
+To be able to access SonataAdminBundle's pages, you need to add its routes
+to your application's routing file:
+
+.. configuration-block::
+
+    .. code-block:: yaml
+
+        # app/config/routing.yml
+
+        admin:
+            resource: '@SonataAdminBundle/Resources/config/routing/sonata_admin.xml'
+            prefix: /admin
+
+        _sonata_admin:
+            resource: .
+            type: sonata_admin
+            prefix: /admin
+
+.. note::
+
+    If you're using XML or PHP to specify your application's configuration,
+    the above routing configuration must be placed in routing.xml or
+    routing.php according to your format (i.e. XML or PHP).
+
+.. note::
+
+    For those curious about the ``resource: .`` setting: it is unusual syntax but used
+    because Symfony requires a resource to be defined (which points to a real file).
+    Once this validation passes Sonata's ``AdminPoolLoader`` is in charge of processing
+    this route and it simply ignores the resource setting.
+
+At this point you can already access the (empty) admin dashboard by visiting the URL:
+``http://yoursite.local/admin/dashboard``.
+
+Step 7: Preparing your Environment
 ----------------------------------
 ----------------------------------
 
 
 As with all bundles you install, it's a good practice to clear the cache and
 As with all bundles you install, it's a good practice to clear the cache and

+ 3 - 42
Resources/doc/reference/getting_started.rst

@@ -6,48 +6,9 @@ but inaccessible. You first need to configure it for your models before you can
 start using it. Here is a quick checklist of what is needed to quickly setup
 start using it. Here is a quick checklist of what is needed to quickly setup
 SonataAdminBundle and create your first admin interface for the models of your application:
 SonataAdminBundle and create your first admin interface for the models of your application:
 
 
-* Step 1: Define SonataAdminBundle routes
-* Step 2: Create an Admin class
-* Step 3: Create an Admin service
-* Step 4: Configuration
-
-Define SonataAdminBundle routes
--------------------------------
-
-To be able to access SonataAdminBundle's pages, you need to add its routes
-to your application's routing file:
-
-.. configuration-block::
-
-    .. code-block:: yaml
-
-        # app/config/routing.yml
-
-        admin:
-            resource: '@SonataAdminBundle/Resources/config/routing/sonata_admin.xml'
-            prefix: /admin
-
-        _sonata_admin:
-            resource: .
-            type: sonata_admin
-            prefix: /admin
-
-.. note::
-
-    If you're using XML or PHP to specify your application's configuration,
-    the above routing configuration must be placed in routing.xml or
-    routing.php according to your format (i.e. XML or PHP).
-
-.. note::
-
-    For those curious about the ``resource: .`` setting: it is unusual syntax but used
-    because Symfony requires a resource to be defined (which points to a real file).
-    Once this validation passes Sonata's ``AdminPoolLoader`` is in charge of processing
-    this route and it simply ignores the resource setting.
-
-At this point you can already access the (empty) admin dashboard by visiting the URL:
-``http://yoursite.local/admin/dashboard``.
-
+* Step 1: Create an Admin class
+* Step 2: Create an Admin service
+* Step 3: Configuration
 
 
 Create an Admin class
 Create an Admin class
 ---------------------
 ---------------------