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

Commit bbe6892

Browse files
committed
Corrections
1 parent 9a65b2a commit bbe6892

File tree

7 files changed

+85
-7
lines changed

7 files changed

+85
-7
lines changed

bundles/block/create_your_own_blocks.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,14 @@ create a service that knows how to handle ``RssBlocks``:
6262
* The method ``setDefaultSettings`` configures a template, title, url and the
6363
maximum amount of items::
6464

65+
66+
// src/Acme/MainBundle/Block/RssBlockService.php
6567
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
6668
use Symfony\Component\HttpFoundation\Response;
6769
use Sonata\BlockBundle\Block\BaseBlockService;
6870
use Sonata\BlockBundle\Block\BlockContextInterface;
6971

70-
class RssBlockService extends extends BaseBlockService
72+
class RssBlockService extends BaseBlockService
7173
{
7274
// ...
7375
public function setDefaultSettings(OptionsResolverInterface $resolver)

bundles/block/introduction.rst

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,44 @@ You can install the bundle in 2 different ways:
2525
Usage
2626
-----
2727

28+
The BlockBundle needs a persistence layer to be configured. This can either be
29+
done globally with the :ref:`Core Bundle <bundles-core-persistence>` or
30+
individually as follows:
31+
32+
.. configuration-block::
33+
34+
.. code-block:: yaml
35+
36+
cmf_core:
37+
persistence:
38+
phpcr:
39+
block_basepath: /cms/content
40+
41+
.. code-block:: xml
42+
43+
<?xml version="1.0" charset="UTF-8" ?>
44+
<container xmlns="http://symfony.com/schema/dic/services">
45+
46+
<config xmlns="http://cmf.symfony.com/schema/dic/core">
47+
<persistence>
48+
<phpcr
49+
block-basepath="/cms/block"
50+
/>
51+
</persistence>
52+
</config>
53+
54+
</container>
55+
56+
.. code-block:: php
57+
58+
$container->loadFromExtension('cmf_core', array(
59+
'persistence' => array(
60+
'phpcr' => array(
61+
'block_basepath' => '/cms/block',
62+
),
63+
),
64+
));
65+
2866
The default settings of a block are defined in the block service. If you use a
2967
third party block, you might want to alter these for your application. Use the
3068
``sonata_block`` key for this. You can define default settings for a block

bundles/core/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ CoreBundle
88
publish_workflow
99
dependency_injection_tags
1010
templating
11-
multilang
11+
persistence
1212
forms

bundles/core/introduction.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@ Sections
3131
* :doc:`publish_workflow`
3232
* :doc:`dependency_injection_tags`
3333
* :doc:`templating`
34-
* :doc:`multilang`
34+
* :doc:`persistence`
3535

3636
.. _`Packagist`: https://packagist.org/packages/symfony-cmf/core-bundle

bundles/core/multilang.rst renamed to bundles/core/persistence.rst

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,45 @@
11
.. index::
22
single: Multi-Language; CoreBundle
33

4-
Multi-language support
5-
----------------------
4+
.. _bundles-core-persistence:
5+
6+
Persistence
7+
-----------
8+
9+
The CoreBundle lets you to centrally configure the persistence layer for all
10+
CMF bundles.
11+
12+
To make the PHPCR-ODM the default persistence layer for all CMF bundles add
13+
the following to your main configuration file:
14+
15+
.. configuration-block::
16+
17+
.. code-block:: yaml
18+
19+
cmf_core:
20+
persistence:
21+
phpcr: ~
22+
23+
.. code-block:: xml
24+
25+
<?xml version="1.0" charset="UTF-8" ?>
26+
<container xmlns="http://symfony.com/schema/dic/services">
27+
28+
<config xmlns="http://cmf.symfony.com/schema/dic/core">
29+
<persistence>
30+
<phpcr />
31+
</persistence>
32+
</config>
33+
34+
</container>
35+
36+
.. code-block:: php
37+
38+
$container->loadFromExtension('cmf_core', array(
39+
'persistence' => array(
40+
'phpcr' => array(),
41+
),
42+
));
643
744
.. _bundles-core-multilang-persisting_multilang_documents:
845

@@ -52,6 +89,7 @@ enforce a single translation strategy for all documents:
5289
$container->loadFromExtension('cmf_core', array(
5390
'persistence' => array(
5491
'phpcr' => array(
92+
'translation_strategy' => 'attribute',
5593
),
5694
),
5795
));

bundles/menu/menu_documents.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ locale to be set via. the ``setLocale`` method::
105105
$menuItem = ...;
106106
$menuItem->setLocale('fr');
107107

108-
See :doc:`../core/multilang`.
108+
See :ref:`Persisting Multilang Documents <bundles-core-multilang-persisting_multilang_documents>` for more details.
109109

110110
Publish Workflow
111111
~~~~~~~~~~~~~~~~

cookbook/create_basic_cms_auto_routing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ In summary:
597597
``/if/this/is/a/path`` then the ``content_path``
598598
represents ``/if/this/is/a``;
599599
* Each element under ``content_path`` represents a section of the URL;
600-
* The first element ``block_path`` uses a *provider* which *specifies* a
600+
* The first element ``blog_path`` uses a *provider* which *specifies* a
601601
path. If that path exists then it will do nothing;
602602
* The second element uses the ``content_datetime`` provider, which will
603603
use a ``DateTime`` object returned from the specified method on the

0 commit comments

Comments
 (0)