This repository was archived by the owner on Sep 16, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 7 files changed +85
-7
lines changed Expand file tree Collapse file tree 7 files changed +85
-7
lines changed Original file line number Diff line number Diff line change @@ -62,12 +62,14 @@ create a service that knows how to handle ``RssBlocks``:
62
62
* The method ``setDefaultSettings `` configures a template, title, url and the
63
63
maximum amount of items::
64
64
65
+
66
+ // src/Acme/MainBundle/Block/RssBlockService.php
65
67
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
66
68
use Symfony\Component\HttpFoundation\Response;
67
69
use Sonata\BlockBundle\Block\BaseBlockService;
68
70
use Sonata\BlockBundle\Block\BlockContextInterface;
69
71
70
- class RssBlockService extends extends BaseBlockService
72
+ class RssBlockService extends BaseBlockService
71
73
{
72
74
// ...
73
75
public function setDefaultSettings(OptionsResolverInterface $resolver)
Original file line number Diff line number Diff line change @@ -25,6 +25,44 @@ You can install the bundle in 2 different ways:
25
25
Usage
26
26
-----
27
27
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
+
28
66
The default settings of a block are defined in the block service. If you use a
29
67
third party block, you might want to alter these for your application. Use the
30
68
``sonata_block `` key for this. You can define default settings for a block
Original file line number Diff line number Diff line change @@ -8,5 +8,5 @@ CoreBundle
8
8
publish_workflow
9
9
dependency_injection_tags
10
10
templating
11
- multilang
11
+ persistence
12
12
forms
Original file line number Diff line number Diff line change @@ -31,6 +31,6 @@ Sections
31
31
* :doc: `publish_workflow `
32
32
* :doc: `dependency_injection_tags `
33
33
* :doc: `templating `
34
- * :doc: `multilang `
34
+ * :doc: `persistence `
35
35
36
36
.. _`Packagist` : https://packagist.org/packages/symfony-cmf/core-bundle
Original file line number Diff line number Diff line change 1
1
.. index ::
2
2
single: Multi-Language; CoreBundle
3
3
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
+ ));
6
43
7
44
.. _bundles-core-multilang-persisting_multilang_documents :
8
45
@@ -52,6 +89,7 @@ enforce a single translation strategy for all documents:
52
89
$container->loadFromExtension('cmf_core', array(
53
90
'persistence' => array(
54
91
'phpcr' => array(
92
+ 'translation_strategy' => 'attribute',
55
93
),
56
94
),
57
95
));
Original file line number Diff line number Diff line change @@ -105,7 +105,7 @@ locale to be set via. the ``setLocale`` method::
105
105
$menuItem = ...;
106
106
$menuItem->setLocale('fr');
107
107
108
- See :doc: ` ../ core/ multilang` .
108
+ See :ref: ` Persisting Multilang Documents < bundles- core- multilang-persisting_multilang_documents >` for more details .
109
109
110
110
Publish Workflow
111
111
~~~~~~~~~~~~~~~~
Original file line number Diff line number Diff line change @@ -597,7 +597,7 @@ In summary:
597
597
``/if/this/is/a/path `` then the ``content_path ``
598
598
represents ``/if/this/is/a ``;
599
599
* 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
601
601
path. If that path exists then it will do nothing;
602
602
* The second element uses the ``content_datetime `` provider, which will
603
603
use a ``DateTime `` object returned from the specified method on the
You can’t perform that action at this time.
0 commit comments