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

Commit 9940951

Browse files
authored
Merge pull request #816 from symfony-cmf/core-doc-update
update core bundle documentation for 2.0
2 parents a9b733f + 752f2ec commit 9940951

File tree

11 files changed

+290
-345
lines changed

11 files changed

+290
-345
lines changed

book/database_layer.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ After this, you have to create getters and setters for the properties.
185185

186186
You may want to implement ``Doctrine\ODM\PHPCR\HierarchyInterface``
187187
which makes it for example possible to leverage the
188-
:ref:`Sonata Admin Child Extension <bundle-core-child-admin-extension>`.
188+
:doc:`Sonata Admin Child Extension <../bundles/sonata_phpcr_admin_integration/core>`.
189189

190190
.. seealso::
191191

book/handling_multilang.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -320,10 +320,8 @@ default locale, for example ``/de/admin/dashboard``. When clicking on the
320320
language switcher, the page reloads and displays the correct content for the
321321
requested language.
322322

323-
If your documents implement the TranslatableInterface, you can
324-
:ref:`configure the translatable admin extension <bundle-core-translatable-admin-extension>`
325-
to get a language choice field to let the administrator
326-
choose in which language to store the content.
323+
If your documents implement the TranslatableInterface, use the
324+
SonataTranslationBundle_ to enable multi-language editing in the admin backend.
327325

328326
Frontend Editing and multi-language
329327
-----------------------------------
@@ -348,3 +346,4 @@ save the edited document in the same language as it was loaded.
348346
.. _`cmf-sandbox config.yml file`: https://github.com/symfony-cmf/cmf-sandbox/blob/master/app/config/config.yml
349347
.. _`PHPCR-ODM documentation on multi-language`: http://docs.doctrine-project.org/projects/doctrine-phpcr-odm/en/latest/reference/multilang.html
350348
.. _`issue`: https://github.com/symfony-cmf/create-bundle/issues/39
349+
.. _SonataTranslationBundle: https://packagist.org/packages/sonata-project/translation-bundle

bundles/core/configuration.rst

Lines changed: 27 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ configuration. When using XML, you can use the
88
Configuration
99
-------------
1010

11+
Some configuration settings set on the CoreBundle are forwarded as default
12+
configuration to all CMF bundles that are installed in your application. This
13+
is explicitly listed below for each configuration option that is forwarded.
14+
1115
.. _config-core-persistence:
1216

1317
``persistence``
@@ -16,8 +20,8 @@ Configuration
1620
``phpcr``
1721
.........
1822

19-
This defines the persistence driver. The default configuration of persistence
20-
is the following configuration:
23+
This enables the persistence driver for the PHP content repository. The default
24+
configuration is the following:
2125

2226
.. configuration-block::
2327

@@ -31,7 +35,6 @@ is the following configuration:
3135
basepath: /cms
3236
manager_registry: doctrine_phpcr
3337
manager_name: ~
34-
use_sonata_admin: auto
3538
translation_strategy: ~
3639
3740
.. code-block:: xml
@@ -47,7 +50,6 @@ is the following configuration:
4750
basepath="/cms"
4851
manager-registery="doctrine_phpcr"
4952
manager-name="null"
50-
use-sonata-admin="auto"
5153
translation-strategy="null"
5254
/>
5355
</persistence>
@@ -65,7 +67,6 @@ is the following configuration:
6567
'basepath' => '/cms/simple',
6668
'manager_registry' => 'doctrine_phpcr',
6769
'manager_name' => null,
68-
'use_sonata_admin' => 'auto',
6970
'translation_strategy' => null,
7071
],
7172
],
@@ -74,8 +75,8 @@ is the following configuration:
7475
``orm``
7576
.......
7677

77-
This defines the persistence driver. The default configuration of persistence
78-
is the following configuration:
78+
This enables the persistence driver for relational databases. The default
79+
configuration is the following:
7980

8081
.. configuration-block::
8182

@@ -87,7 +88,6 @@ is the following configuration:
8788
orm:
8889
enabled: false
8990
manager_name: ~
90-
use_sonata_admin: auto
9191
9292
.. code-block:: xml
9393
@@ -100,7 +100,6 @@ is the following configuration:
100100
<phpcr
101101
enabled="false"
102102
manager-name="null"
103-
use-sonata-admin="auto"
104103
/>
105104
</persistence>
106105
</config>
@@ -115,7 +114,6 @@ is the following configuration:
115114
'phpcr' => [
116115
'enabled' => false,
117116
'manager_name' => null,
118-
'use_sonata_admin' => 'auto',
119117
],
120118
],
121119
]);
@@ -125,7 +123,8 @@ is the following configuration:
125123

126124
.. include:: ../_partials/persistence_phpcr_enabled.rst.inc
127125

128-
Enabling this setting will also automatically enable the equivalent setting in the following Bundles:
126+
This setting is propagated as default value to all installed CMF bundles that support
127+
this setting:
129128

130129
* :doc:`BlockBundle <../block/introduction>`
131130
* :doc:`ContentBundle <../content/introduction>`
@@ -135,7 +134,6 @@ Enabling this setting will also automatically enable the equivalent setting in t
135134
* :doc:`RoutingBundle <../routing/introduction>`
136135
* :doc:`SearchBundle <../search/introduction>`
137136
* :doc:`SimpleCmsBundle <../simple_cms/introduction>`
138-
* :doc:`TreeBrowserCmsBundle <../tree_browser/introduction>`
139137

140138
``basepath``
141139
""""""""""""
@@ -144,22 +142,28 @@ Enabling this setting will also automatically enable the equivalent setting in t
144142

145143
The basepath for CMS documents in the PHPCR tree.
146144

147-
Enabling this setting will also automatically enable the equivalent settings in the following Bundles:
145+
This setting is propagated as default value to all installed CMF bundles that support
146+
this setting:
148147

149148
* :doc:`BlockBundle <../block/introduction>`
150149
* :doc:`ContentBundle <../content/introduction>`
151150
* :doc:`MediaBundle <../media/introduction>`
152151
* :doc:`MenuBundle <../menu/introduction>`
153152
* :doc:`RoutingBundle <../routing/introduction>`
154153
* :doc:`SearchBundle <../search/introduction>`
154+
* :doc:`SeoBundle <../seo/introduction>`
155155
* :doc:`SimpleCmsBundle <../simple_cms/introduction>`
156156

157157
``manager_registry``
158158
""""""""""""""""""""
159159

160160
**type**: ``string`` **default**: ``doctrine_phpcr``
161161

162-
Enabling this setting will also automatically enable the equivalent settings in the following Bundles:
162+
The doctrine registry from which to get the document manager. This setting
163+
only needs to be changed when configuring multiple manager registries.
164+
165+
This setting is propagated as default value to all installed CMF bundles that support
166+
this setting:
163167

164168
* :doc:`SearchBundle <../search/introduction>`
165169
* :doc:`SimpleCmsBundle <../simple_cms/introduction>`
@@ -170,9 +174,10 @@ Enabling this setting will also automatically enable the equivalent settings in
170174
**type**: ``string`` **default**: ``null``
171175

172176
The name of the Doctrine Manager to use. ``null`` tells the manager registry to
173-
retrieve the default manager.<persistence>
177+
retrieve the default manager.
174178

175-
Enabling this setting will also automatically enable the equivalent setting in the following Bundles:
179+
This setting is propagated as default value to all installed CMF bundles that support
180+
this setting:
176181

177182
* :doc:`BlockBundle <../block/introduction>`
178183
* :doc:`MediaBundle <../media/introduction>`
@@ -181,44 +186,27 @@ Enabling this setting will also automatically enable the equivalent setting in t
181186
* :doc:`SearchBundle <../search/introduction>`
182187
* :doc:`SimpleCmsBundle <../simple_cms/introduction>`
183188

184-
``use_sonata_admin``
185-
""""""""""""""""""""
186-
187-
**type**: ``enum`` **valid values**: ``true|false|auto`` **default**: ``auto``
188-
189-
If ``true``, the admin classes for SimpleCmsBundle pages are activated. If set
190-
to ``auto``, the admin services are activated only if the
191-
SonataPhpcrAdminBundle is present.
192-
193-
Enabling this setting will also automatically enable the equivalent setting in the following Bundles:
194-
195-
* :doc:`BlockBundle <../block/introduction>`
196-
* :doc:`ContentBundle <../content/introduction>`
197-
* :doc:`MenuBundle <../menu/introduction>`
198-
* :doc:`RoutingBundle <../routing/introduction>`
199-
* :doc:`SimpleCmsBundle <../simple_cms/introduction>`
200-
201189
``translation_strategy``
202190
""""""""""""""""""""""""
203191

204192
**type**: ``string`` **default**: ``null``
205193

206-
This setting can be used to force a specific translation strategy for all documents.
194+
This setting can be used to :ref:`force a specific translation strategy <bundles-core-multilang-global_translation_strategy>`
195+
for all documents.
207196

208197
.. _config-core-multilang:
209198

210199
``multilang``
211200
~~~~~~~~~~~~~
212201

213-
This configures whether multiple languages mode should be activated.
202+
This configures the locales to use in multiple languages mode.
214203

215204
If the ``multilang`` option is *not* defined at all, the CoreBundle registers a
216205
listener for Doctrine PHPCR-ODM that modifies PHPCR-ODM metadata to remove the
217206
translatable attribute from all fields.
218207

219-
If multi-language is enabled, the ``TranslatableExtension`` for
220-
``SonataAdminBundle`` is enabled and the locales will be configured on all CMF
221-
bundles that use this configuration:
208+
If multi-language is enabled, the locales will be configured as default on all
209+
installed CMF bundles that use this configuration:
222210

223211
* :doc:`RoutingBundle <../routing/introduction>`
224212
* :doc:`SimpleCmsBundle <../simple_cms/introduction>`
@@ -263,7 +251,7 @@ bundles that use this configuration:
263251

264252
**type**: ``array`` **default**: ``null``
265253

266-
This define languages that can be used.
254+
List of the languages that can be used with the storage.
267255

268256
``publish_workflow``
269257
~~~~~~~~~~~~~~~~~~~~
@@ -311,71 +299,3 @@ only published routes and content can be accessed.
311299
'request_listener' => true,
312300
],
313301
]);
314-
315-
Sonata Admin
316-
------------
317-
318-
This section configures the Sonata Admin Extensions, see:
319-
320-
* :ref:`Publish Workflow Admin Extensions <bundle-core-workflow-admin-extensions>`;
321-
* :ref:`Translatable Admin Extension <bundle-core-translatable-admin-extension>`.
322-
* :ref:`Child Admin Extension <bundle-core-child-admin-extension>`.
323-
324-
.. configuration-block::
325-
326-
.. code-block:: yaml
327-
328-
# app/config/config.yml
329-
cmf_core:
330-
sonata_admin:
331-
extensions:
332-
publishable:
333-
form_group: form.group_publish_workflow
334-
publish_time:
335-
form_group: form.group_general
336-
translatable:
337-
form_group: form.group_general
338-
339-
.. code-block:: xml
340-
341-
<!-- app/config/config.xml -->
342-
<?xml version="1.0" charset="UTF-8" ?>
343-
<container xmlns="http://symfony.com/schema/dic/services">
344-
345-
<config xmlns="http://cmf.symfony.com/schema/dic/core">
346-
<sonata-admin>
347-
<extension>
348-
<publishable form-group="form.group_publish_workflow" />
349-
<publish-time form-group="form.group_general" />
350-
<translatable form-group="form.group_general" />
351-
</extension>
352-
</sonata-admin>
353-
</config>
354-
</container>
355-
356-
.. code-block:: php
357-
358-
// app/config/config.php
359-
$container->loadFromExtension('cmf_core', [
360-
'sonata_admin' => [
361-
'extensions' => [
362-
'publishable' => [
363-
'form_group' => 'form.group_publish_workflow',
364-
],
365-
'publish_time' => [
366-
'form_group' => 'form.group_general',
367-
],
368-
'translatable' => [
369-
'form_group' => 'form.group_general',
370-
],
371-
],
372-
],
373-
]);
374-
375-
``form_group``
376-
~~~~~~~~~~~~~~
377-
378-
**type**: ``string`` **default**: as in above example.
379-
380-
Defines which form group the fields from this extension will appear in within
381-
the Sonata Admin edit interface.

bundles/core/dependency_injection_tags.rst

Lines changed: 0 additions & 18 deletions
This file was deleted.

bundles/core/index.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ CoreBundle
66

77
introduction
88
publish_workflow
9-
dependency_injection_tags
109
templating
1110
persistence
1211
forms

bundles/core/introduction.rst

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,13 @@ CoreBundle
77
This bundle provides common functionality, helpers and utilities for the
88
other CMF bundles.
99

10-
One of the provided features is an interface and implementation of a publish
11-
workflow checker with an accompanying interface that models can implement if
12-
they want to support this checker.
10+
The major features are:
1311

14-
Furthermore, it provides a Twig helper exposing several useful functions for
15-
Twig templates to interact with PHPCR-ODM documents.
16-
17-
Finally, most of its configuration settings are automatically applied as
18-
defaults for most of the other CMF Bundles.
12+
* Publish workflow interfaces and publish workflow checker to handle whether
13+
documents should be visible on the site or not;
14+
* Twig helper exposing several useful functions to interact with PHPCR-ODM
15+
documents from within Twig templates;
16+
* Propagate default configuration to the other CMF bundles.
1917

2018
Installation
2119
------------
@@ -27,8 +25,8 @@ Sections
2725
--------
2826

2927
* :doc:`publish_workflow`
30-
* :doc:`dependency_injection_tags`
3128
* :doc:`templating`
29+
* :doc:`forms`
3230
* :doc:`persistence`
3331
* :doc:`configuration`
3432

0 commit comments

Comments
 (0)