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

Commit 308b918

Browse files
committed
Merge branch '2.0'
2 parents 73bdbd3 + a89c438 commit 308b918

File tree

16 files changed

+244
-159
lines changed

16 files changed

+244
-159
lines changed

bundles/block/create_your_own_blocks.rst

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ the location where the RSS feed should be shown. The easiest way is to extend
3030
free to do create your own document. At least, you have to implement
3131
``Sonata\BlockBundle\Model\BlockInterface``. In your document, you
3232
need to define the ``getType`` method which returns the type name of your block,
33-
for instance ``acme_main.block.rss``::
33+
for instance ``rss_block``::
3434

35-
// src/Acme/MainBundle/Document/RssBlock.php
36-
namespace Acme\MainBundle\Document;
35+
// src/AppBundle/Document/RssBlock.php
36+
namespace AppBundle\Document;
3737

3838
use Doctrine\ODM\PHPCR\Mapping\Annotations as PHPCR;
3939

@@ -56,7 +56,7 @@ for instance ``acme_main.block.rss``::
5656

5757
public function getType()
5858
{
59-
return 'acme_main.block.rss';
59+
return 'app.rss_block';
6060
}
6161

6262
public function getOptions()
@@ -97,8 +97,8 @@ services provided by the CmfBlockBundle are in the namespace
9797
For your RSS block, you need a custom service
9898
that knows how to fetch the feed data of an ``RssBlock``::
9999

100-
// src/Acme/MainBundle/Block/RssBlockService.php
101-
namespace Acme\MainBundle\Block;
100+
// src/AppBundle/Block/RssBlockService.php
101+
namespace AppBundle\Block;
102102

103103
use Symfony\Component\HttpFoundation\Response;
104104
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
@@ -125,7 +125,8 @@ that knows how to fetch the feed data of an ``RssBlock``::
125125
$resolver->setDefaults(array(
126126
'url' => false,
127127
'title' => 'Feed items',
128-
'template' => 'AcmeMainBundle:Block:rss.html.twig',
128+
// template is at app/Resources/views/block/rss.html.twig
129+
'template' => 'block/rss.html.twig',
129130
));
130131
}
131132

@@ -308,33 +309,37 @@ handles, as per the ``getType`` method of the block. The second argument is the
308309

309310
.. code-block:: yaml
310311
311-
sandbox_main.block.rss:
312-
class: Acme\MainBundle\Block\RssBlockService
313-
arguments:
314-
- "acme_main.block.rss"
315-
- "@templating"
316-
tags:
317-
- {name: "sonata.block"}
312+
# app/config/services.yml
313+
services:
314+
app.rss_block:
315+
class: AppBundle\Block\RssBlockService
316+
arguments:
317+
- "app.rss_block"
318+
- "@templating"
319+
tags:
320+
- { name: "sonata.block" }
318321
319322
.. code-block:: xml
320323
321-
<service id="sandbox_main.block.rss" class="Acme\MainBundle\Block\RssBlockService">
324+
<!-- app/config/services.xml -->
325+
<service id="app.rss_block" class="AppBundle\Block\RssBlockService">
322326
<tag name="sonata.block" />
323327
324-
<argument>acme_main.block.rss</argument>
328+
<argument>app.rss_block</argument>
325329
<argument type="service" id="templating" />
326330
</service>
327331
328332
.. code-block:: php
329333
334+
// app/config/services.php
330335
use Symfony\Component\DependencyInjection\Definition;
331336
use Symfony\Component\DependencyInjection\Reference;
332337
333338
$container
334-
->addDefinition('sandbox_main.block.rss', new Definition(
335-
'Acme\MainBundle\Block\RssBlockService',
339+
->addDefinition('app.rss_block', new Definition(
340+
'AppBundle\Block\RssBlockService',
336341
array(
337-
'acme_main.block.rss',
342+
'app.rss_block',
338343
new Reference('templating'),
339344
)
340345
))

bundles/block/introduction.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ BlockBundle
99
manage fragments of content, so-called blocks, that are persisted in a
1010
database and can be incorporated into any page layout.
1111

12-
The Symfony2 CMF BlockBundle also provides a few commonly used standard blocks,
12+
The CmfBlockBundle also provides a few commonly used standard blocks,
1313
including the ability to edit them. See :doc:`types`.
1414

1515
Installation
@@ -98,7 +98,7 @@ specific settings for one of the block classes.
9898
# app/config/config.yml
9999
sonata_block:
100100
blocks:
101-
acme_main.block.news:
101+
app.news_block:
102102
settings:
103103
maxItems: 3
104104
blocks_by_class:
@@ -113,7 +113,7 @@ specific settings for one of the block classes.
113113
<container xmlns="http://symfony.com/schema/dic/services">
114114
115115
<config xmlns="http://sonata-project.com/schema/dic/block">
116-
<blocks id="acme_main.block.rss">
116+
<blocks id="app.news_block">
117117
<setting id="maxItems">3</setting>
118118
</blocks>
119119
<block-by-class class="Symfony\Cmf\Bundle\BlockBundle\Doctrine\Phpcr\RssBlock">
@@ -127,7 +127,7 @@ specific settings for one of the block classes.
127127
// app/config/config.php
128128
$container->loadFromExtension('sonata_block', array(
129129
'blocks' => array(
130-
'acme_main.block.rss' => array(
130+
'app.news_block' => array(
131131
'settings' => array(
132132
'maxItems' => 3,
133133
),

bundles/content/exposing_content_via_rest.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ commands:
139139
140140
This is all it takes to enable read support via JSON or XML!
141141

142-
The JMS serializer comes with sense defaults for Doctrine object mappers.
142+
The JMS serializer comes with sensible defaults for Doctrine object mappers.
143143
However it might be necessary to add additional mapping to more tightly
144144
control what gets exposed. See the `documentation of the JMS serializer`_
145145
for details.

bundles/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Bundles
1616
search/index
1717
seo/index
1818
simple_cms/index
19+
sonata_phpcr_admin_integration/index
1920
tree_browser/index
2021

2122
.. include:: map.rst.inc

bundles/map.rst.inc

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,14 @@ library or they introduce a complete new concept.
8181
* :doc:`tree_browser/introduction`
8282
* :doc:`tree_browser/configuration`
8383

84+
Admin Integrations
85+
~~~~~~~~~~~~~~~~~~
86+
87+
Since version 2 of the CMF, we provide a separate bundle with admin implementations for the
88+
SonataDoctrinePHPCRAdminBundle_.
89+
90+
* :doc:`sonata_phpcr_admin_integration/index`
91+
8492
Showcase Bundles
8593
~~~~~~~~~~~~~~~~
8694

@@ -120,6 +128,4 @@ help with integrating PHPCR concepts into the Symfony Framework.
120128
* :doc:`phpcr_odm/multiple_sessions`
121129
* :doc:`phpcr_odm/configuration`
122130

123-
* SonataDoctrinePHPCRAdminBundle_
124-
125131
.. _SonataDoctrinePHPCRAdminBundle: https://sonata-project.org/bundles/doctrine-phpcr-admin/master/doc/index.html

bundles/seo/extractors.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ description, you can implement both interfaces and your result will be::
5050
use Symfony\Cmf\Bundle\SeoBundle\Extractor\DescriptionReadInterface;
5151
use Symfony\Cmf\Bundle\SeoBundle\Extractor\ExtrasReadInterface;
5252

53-
class Article implements TitleReadInterface, DescriptionReadInterface, ExtraReadInterface
53+
class Article implements TitleReadInterface, DescriptionReadInterface, ExtrasReadInterface
5454
{
5555
protected $title;
5656
protected $publishDate;
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
ContentBundle
2+
=============
3+
4+
This integration becomes available once the :doc:`CmfContentBundle
5+
<../content/introduction>` is installed.
6+
7+
Content bundle support consists in an admin interface for the ``StaticContent``
8+
document. Enable this admin using:
9+
10+
.. configuration-block::
11+
12+
.. code-block:: yaml
13+
14+
# app/config/config.yml
15+
cmf_sonata_phpcr_admin_integration:
16+
bundles:
17+
content: ~
18+
19+
.. code-block:: xml
20+
21+
<!-- app/config/config.xml -->
22+
<?xml version="2.0" encoding="UTF-8" ?>
23+
<container xmlns="http://symfony.com/schema/dic/services"
24+
xmlns:xsd="http://www.w3.org/2001/XMLSchema-instance"
25+
xsd:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd
26+
http://cmf.symfony.com/schema/dic/sonata_admin_integration http://cmf.symfony.com/schema/dic/sonata_admin_integration/sonata_admin_integration.xsd"
27+
>
28+
29+
<config xmlns="http://cmf.symfony.com/schema/dic/sonata_admin_integration">
30+
<bundles>
31+
<content/>
32+
</bundles>
33+
</config>
34+
</container>
35+
36+
.. code-block:: php
37+
38+
// app/config/config.php
39+
$container->loadFromExtension('cmf_sonata_phpcr_admin_integration', [
40+
'bundles' => [
41+
'content' => true,
42+
],
43+
]);
44+
45+
.. tip::
46+
47+
Install the IvoryCKEditorBundle_ to enable a CKEditor to edit the content
48+
body:
49+
50+
.. code-block:: bash
51+
52+
$ composer require egeloen/ckeditor-bundle
53+
54+
.. _IvoryCKEditorBundle: https://github.com/egeloen/IvoryCKEditorBundle
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
CoreBundle
2+
==========
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
SonataPhpcrAdminIntegrationBundle
2+
=================================
3+
4+
.. toctree::
5+
:maxdepth: 2
6+
7+
introduction
8+
core
9+
content
10+
menu
11+
routing
12+
routing_auto
13+
seo
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
.. index::
2+
single: Sonata; Bundles
3+
single: SonataPhpcrAdminIntegrationBundle
4+
5+
SonataPhpcrAdminIntegrationBundle
6+
=================================
7+
8+
The SonataPhpcrAdminIntegrationBundle provides admin services for the Sonata
9+
Admin tool. Additionally, it provides admin extensions to improve your
10+
custom admin services.
11+
12+
Installation
13+
------------
14+
15+
You can install this bundle `with composer`_ using the
16+
``symfony-cmf/sonata-phpcr-admin-integration-bundle`` package on Packagist_.
17+
18+
As this bundle integrates the SonataDoctrinePhpcrAdminBundle_, please follow
19+
`its official installation guide`_ to install the bundle.
20+
21+
After this, enable both the CmfSonataPhpcrAdminIntegrationBundle as well as the
22+
SonataDoctrinePhpcrAdminBundle related bundles::
23+
24+
// app/appKernel.php
25+
26+
// ...
27+
public function registerBundles()
28+
{
29+
$bundles = array(
30+
// ...
31+
32+
// SonataAdminBundle related
33+
new Sonata\CoreBundle\SonataCoreBundle(),
34+
new Sonata\BlockBundle\SonataBlockBundle(),
35+
new Knp\Bundle\MenuBundle\KnpMenuBundle(),
36+
new Sonata\AdminBundle\SonataAdminBundle(),
37+
38+
// SonataDoctrinePhpcrAdminBundle related
39+
new Symfony\Cmf\Bundle\TreeBrowserBundle\CmfTreeBrowserBundle(),
40+
new Sonata\DoctrinePHPCRAdminBundle\SonataDoctrinePHPCRAdminBundle(),
41+
42+
// CmfSonataPhpcrAdminIntegrationBundle
43+
new Symfony\Cmf\Bundle\SonataPhpcrAdminIntegrationBundle\CmfSonataPhpcrAdminIntegrationBundle(),
44+
);
45+
46+
// ...
47+
48+
return $bundles;
49+
}
50+
51+
Usage
52+
-----
53+
54+
The integration bundle provides admins for the CMF bundles. The related
55+
configuration section of a bundle becomes available whenever a CMF bundle is
56+
registered in the ``AppKernel``. For instance, to enable the admin integration
57+
for the :doc:`CmfContentBundle <../content/introduction>`, use the following
58+
config:
59+
60+
.. configuration-block::
61+
62+
.. code-block:: yaml
63+
64+
# app/config/config.yml
65+
cmf_sonata_phpcr_admin_integration:
66+
bundles:
67+
content: ~
68+
69+
.. code-block:: xml
70+
71+
<!-- app/config/config.xml -->
72+
<?xml version="2.0" encoding="UTF-8" ?>
73+
<container xmlns="http://symfony.com/schema/dic/services"
74+
xmlns:xsd="http://www.w3.org/2001/XMLSchema-instance"
75+
xsd:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd
76+
http://cmf.symfony.com/schema/dic/sonata_admin_integration http://cmf.symfony.com/schema/dic/sonata_admin_integration/sonata_admin_integration.xsd"
77+
>
78+
79+
<config xmlns="http://cmf.symfony.com/schema/dic/sonata_admin_integration">
80+
<bundles>
81+
<content/>
82+
</bundles>
83+
</config>
84+
</container>
85+
86+
.. code-block:: php
87+
88+
// app/config/config.php
89+
$container->loadFromExtension('cmf_sonata_phpcr_admin_integration', [
90+
'bundles' => [
91+
'content' => true,
92+
],
93+
]);
94+
95+
Configuration
96+
-------------
97+
98+
The configuration is split into a section for each supported CMF bundle.
99+
Each part is only available if the corresponding bundle is installed and
100+
registered with the kernel.
101+
102+
.. toctree::
103+
104+
core
105+
content
106+
menu
107+
routing
108+
routing_auto
109+
seo
110+
111+
Learn More
112+
----------
113+
114+
* SonataAdminBundle_
115+
* SonataDoctrinePhpcrAdminBundle_
116+
* :doc:`The Sonata Admin chapter of the tutorial <../../tutorial/sonata-admin>`
117+
118+
.. _`with composer`: https://getcomposer.org
119+
.. _`Packagist`: https://packagist.org/packages/symfony-cmf/sonata-admin-integration-bundle
120+
.. _SonataDoctrinePhpcrAdminBundle: https://sonata-project.org/bundles/doctrine-phpcr-admin/1-x/doc/index.html
121+
.. _its official installation guide: https://sonata-project.org/bundles/doctrine-phpcr-admin/1-x/doc/reference/installation.html
122+
.. _SonataAdminBundle: https://sonata-project.org/bundles/admin/3-x/doc/index.html

0 commit comments

Comments
 (0)