Skip to content
This repository was archived by the owner on Sep 16, 2021. It is now read-only.

Commit 1bafca3

Browse files
committed
continued sonata admin
1 parent e58dfb1 commit 1bafca3

File tree

4 files changed

+117
-138
lines changed

4 files changed

+117
-138
lines changed

bundles/map.rst.inc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ library or they introduce a complete new concept.
8484
Admin Integrations
8585
~~~~~~~~~~~~~~~~~~
8686

87-
Since version 2 of the CMF, a seperate bundle is provided to integrate with the
88-
SonataAdminBundle.
87+
Since version 2 of the CMF, we provide a separate bundle with admin implementations for the
88+
SonataDoctrinePHPCRAdminBundle_.
8989

9090
* :doc:`sonata_phpcr_admin_integration/index`
9191

@@ -127,3 +127,5 @@ help with integrating PHPCR concepts into the Symfony Framework.
127127
* :doc:`phpcr_odm/multilang`
128128
* :doc:`phpcr_odm/multiple_sessions`
129129
* :doc:`phpcr_odm/configuration`
130+
131+
.. _SonataDoctrinePHPCRAdminBundle: https://sonata-project.org/bundles/doctrine-phpcr-admin/master/doc/index.html

bundles/sonata_phpcr_admin_integration/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
SonataAdminIntegrationBundle
2-
============================
1+
SonataPhpcrAdminIntegrationBundle
2+
=================================
33

44
.. toctree::
55
:maxdepth: 2

bundles/sonata_phpcr_admin_integration/introduction.rst

Lines changed: 108 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
single: SonataPhpcrAdminIntegrationBundle
44

55
SonataPhpcrAdminIntegrationBundle
6-
============================
6+
=================================
77

88
The SonataPhpcrAdminIntegrationBundle provides admin services for the Sonata
99
Admin tool. Additionally, it provides admin extensions to improve your
@@ -34,7 +34,7 @@ SonataDoctrinePhpcrAdminBundle related bundles::
3434
new Sonata\BlockBundle\SonataBlockBundle(),
3535
new Knp\Bundle\MenuBundle\KnpMenuBundle(),
3636
new Sonata\AdminBundle\SonataAdminBundle(),
37-
37+
3838
// SonataDoctrinePhpcrAdminBundle related
3939
new Symfony\Cmf\Bundle\TreeBrowserBundle\CmfTreeBrowserBundle(),
4040
new Sonata\DoctrinePHPCRAdminBundle\SonataDoctrinePHPCRAdminBundle(),
@@ -48,6 +48,112 @@ SonataDoctrinePhpcrAdminBundle related bundles::
4848
return $bundles;
4949
}
5050

51+
Sonata requires the ``sonata_block`` bundle to be configured in your main
52+
configuration:
53+
54+
.. configuration-block::
55+
56+
.. code-block:: yaml
57+
58+
# app/config/config.yml
59+
60+
# ...
61+
sonata_block:
62+
default_contexts: [cms]
63+
blocks:
64+
# Enable the SonataAdminBundle block
65+
sonata.admin.block.admin_list:
66+
contexts: [admin]
67+
68+
.. code-block:: xml
69+
70+
<!-- app/config/config.xml -->
71+
<?xml version="1.0" encoding="UTF-8" ?>
72+
<container xmlns="htp://symfony.com/schema/dic/services">
73+
<config xmlns="http://sonata-project.org/schema/dic/block">
74+
<default-context>cms</default-context>
75+
76+
<block id="sonata.admin.block.admin_list">
77+
<context>admin</context>
78+
</block>
79+
</config>
80+
</container>
81+
82+
.. code-block:: php
83+
84+
// app/config/config.php
85+
$container->loadFromExtension('sonata_block', array(
86+
'default_contexts' => array('cms'),
87+
'blocks' => array(
88+
'sonata.admin.block.admin_list' => array(
89+
'contexts' => array('admin'),
90+
),
91+
),
92+
));
93+
94+
and it requires the following entries in your routing file:
95+
96+
.. configuration-block::
97+
98+
.. code-block:: yaml
99+
100+
# app/config/routing.yml
101+
102+
admin:
103+
resource: '@SonataAdminBundle/Resources/config/routing/sonata_admin.xml'
104+
prefix: /admin
105+
106+
_sonata_admin:
107+
resource: .
108+
type: sonata_admin
109+
prefix: /admin
110+
111+
.. code-block:: xml
112+
113+
<!-- app/config/routing.xml -->
114+
<?xml version="1.0" encoding="UTF-8" ?>
115+
<routes xmlns="http://symfony.com/schema/routing"
116+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
117+
xsi:schemaLocation="http://symfony.com/schema/routing
118+
http://symfony.com/schema/routing/routing-1.0.xsd">
119+
120+
<import
121+
resource="@SonataAdminBundle/Resources/config/sonata_admin.xml"
122+
prefix="/admin"
123+
/>
124+
125+
<import
126+
resource="."
127+
type="sonata_admin"
128+
prefix="/admin"
129+
/>
130+
131+
</routes>
132+
133+
.. code-block:: php
134+
135+
// app/config/routing.php
136+
use Symfony\Component\Routing\RouteCollection;
137+
138+
$collection = new RouteCollection();
139+
$routing = $loader->import(
140+
"@SonataAdminBundle/Resources/config/sonata_admin.xml"
141+
);
142+
$routing->setPrefix('/admin');
143+
$collection->addCollection($routing);
144+
145+
$_sonataAdmin = $loader->import('.', 'sonata_admin');
146+
$_sonataAdmin->addPrefix('/admin');
147+
$collection->addCollection($_sonataAdmin);
148+
149+
return $collection;
150+
151+
and publish your assets (remove ``--symlink`` if you use Windows!):
152+
153+
.. code-block:: bash
154+
155+
$ php bin/console assets:install --symlink web/
156+
51157
Usage
52158
-----
53159

tutorial/sonata-admin.rst

Lines changed: 3 additions & 132 deletions
Original file line numberDiff line numberDiff line change
@@ -4,139 +4,10 @@ The Backend - Sonata Admin
44
In this chapter you will build an administration interface with the help
55
of the SonataDoctrinePHPCRAdminBundle_.
66

7-
Installation
8-
------------
7+
For the setup, follow the instructions in :doc:`../bundles/sonata_admin_integration/introduction`.
98

10-
Ensure that you installed the ``sonata-project/doctrine-phpcr-admin-bundle``
11-
package as detailed in the :ref:`gettingstarted_installadditionbundles`
12-
section.
13-
14-
Enable the Sonata related bundles to your kernel::
15-
16-
// app/AppKernel.php
17-
class AppKernel extends Kernel
18-
{
19-
public function registerBundles()
20-
{
21-
$bundles = array(
22-
// ...
23-
new Knp\Bundle\MenuBundle\KnpMenuBundle(),
24-
new Sonata\CoreBundle\SonataCoreBundle(),
25-
new Sonata\jQueryBundle\SonatajQueryBundle(),
26-
new Sonata\BlockBundle\SonataBlockBundle(),
27-
new Sonata\AdminBundle\SonataAdminBundle(),
28-
new Sonata\DoctrinePHPCRAdminBundle\SonataDoctrinePHPCRAdminBundle(),
29-
);
30-
31-
// ...
32-
}
33-
}
34-
35-
Sonata requires the ``sonata_block`` bundle to be configured in your main
36-
configuration:
37-
38-
.. configuration-block::
39-
40-
.. code-block:: yaml
41-
42-
# app/config/config.yml
43-
44-
# ...
45-
sonata_block:
46-
default_contexts: [cms]
47-
blocks:
48-
# Enable the SonataAdminBundle block
49-
sonata.admin.block.admin_list:
50-
contexts: [admin]
51-
52-
.. code-block:: xml
53-
54-
<!-- app/config/config.xml -->
55-
<?xml version="1.0" encoding="UTF-8" ?>
56-
<container xmlns="htp://symfony.com/schema/dic/services">
57-
<config xmlns="http://sonata-project.org/schema/dic/block">
58-
<default-context>cms</default-context>
59-
60-
<block id="sonata.admin.block.admin_list">
61-
<context>admin</context>
62-
</block>
63-
</config>
64-
</container>
65-
66-
.. code-block:: php
67-
68-
// app/config/config.php
69-
$container->loadFromExtension('sonata_block', array(
70-
'default_contexts' => array('cms'),
71-
'blocks' => array(
72-
'sonata.admin.block.admin_list' => array(
73-
'contexts' => array('admin'),
74-
),
75-
),
76-
));
77-
78-
and it requires the following entries in your routing file:
79-
80-
.. configuration-block::
81-
82-
.. code-block:: yaml
83-
84-
# app/config/routing.yml
85-
86-
admin:
87-
resource: '@SonataAdminBundle/Resources/config/routing/sonata_admin.xml'
88-
prefix: /admin
89-
90-
_sonata_admin:
91-
resource: .
92-
type: sonata_admin
93-
prefix: /admin
94-
95-
.. code-block:: xml
96-
97-
<!-- app/config/routing.xml -->
98-
<?xml version="1.0" encoding="UTF-8" ?>
99-
<routes xmlns="http://symfony.com/schema/routing"
100-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
101-
xsi:schemaLocation="http://symfony.com/schema/routing
102-
http://symfony.com/schema/routing/routing-1.0.xsd">
103-
104-
<import
105-
resource="@SonataAdminBundle/Resources/config/sonata_admin.xml"
106-
prefix="/admin"
107-
/>
108-
109-
<import
110-
resource="."
111-
type="sonata_admin"
112-
prefix="/admin"
113-
/>
114-
115-
</routes>
116-
117-
.. code-block:: php
118-
119-
// app/config/routing.php
120-
use Symfony\Component\Routing\RouteCollection;
121-
122-
$collection = new RouteCollection();
123-
$routing = $loader->import(
124-
"@SonataAdminBundle/Resources/config/sonata_admin.xml"
125-
);
126-
$routing->setPrefix('/admin');
127-
$collection->addCollection($routing);
128-
129-
$_sonataAdmin = $loader->import('.', 'sonata_admin');
130-
$_sonataAdmin->addPrefix('/admin');
131-
$collection->addCollection($_sonataAdmin);
132-
133-
return $collection;
134-
135-
and publish your assets (remove ``--symlink`` if you use Windows!):
136-
137-
.. code-block:: bash
138-
139-
$ php bin/console assets:install --symlink web/
9+
Configuration
10+
-------------
14011

14112
Now start a local webserver:
14213

0 commit comments

Comments
 (0)