diff --git a/bundles/core/configuration.rst b/bundles/core/configuration.rst
index 7466a093..8ab3311d 100644
--- a/bundles/core/configuration.rst
+++ b/bundles/core/configuration.rst
@@ -55,18 +55,18 @@ is the following configuration:
.. code-block:: php
- $container->loadFromExtension('cmf_core', array(
- 'persistence' => array(
- 'phpcr' => array(
+ $container->loadFromExtension('cmf_core', [
+ 'persistence' => [
+ 'phpcr' => [
'enabled' => false,
'basepath' => '/cms/simple',
'manager_registry' => 'doctrine_phpcr',
'manager_name' => null,
'use_sonata_admin' => 'auto',
'translation_strategy' => null,
- ),
- ),
- ));
+ ],
+ ],
+ ]);
``orm``
.......
@@ -104,15 +104,15 @@ is the following configuration:
.. code-block:: php
- $container->loadFromExtension('cmf_core', array(
- 'persistence' => array(
- 'phpcr' => array(
+ $container->loadFromExtension('cmf_core', [
+ 'persistence' => [
+ 'phpcr' => [
'enabled' => false,
'manager_name' => null,
'use_sonata_admin' => 'auto',
- ),
- ),
- ));
+ ],
+ ],
+ ]);
``enabled``
"""""""""""
@@ -240,14 +240,14 @@ bundles that use this configuration:
.. code-block:: php
- $container->loadFromExtension('cmf_core', array(
- 'multilang' => array(
- 'locales' => array(
+ $container->loadFromExtension('cmf_core', [
+ 'multilang' => [
+ 'locales' => [
'en',
'fr',
- ),
- ),
- ));
+ ],
+ ],
+ ]);
``locales``
...........
@@ -291,14 +291,14 @@ only published routes and content can be accessed.
.. code-block:: php
- $container->loadFromExtension('cmf_core', array(
- 'publish_workflow' => array(
+ $container->loadFromExtension('cmf_core', [
+ 'publish_workflow' => [
'enabled' => true,
'checker_service' => 'cmf_core.publish_workflow.checker.default',
'view_non_published_role' => 'ROLE_CAN_VIEW_NON_PUBLISHED',
'request_listener' => true,
- ),
- ));
+ ],
+ ]);
Sonata Admin
------------
@@ -341,21 +341,21 @@ This section configures the Sonata Admin Extensions, see:
.. code-block:: php
- $container->loadFromExtension('cmf_core', array(
- 'sonata_admin' => array(
- 'extensions' => array(
- 'publishable' => array(
+ $container->loadFromExtension('cmf_core', [
+ 'sonata_admin' => [
+ 'extensions' => [
+ 'publishable' => [
'form_group' => 'form.group_publish_workflow',
- ),
- 'publish_time' => array(
+ ],
+ 'publish_time' => [
'form_group' => 'form.group_general',
- ),
- 'translatable' => array(
+ ],
+ 'translatable' => [
'form_group' => 'form.group_general',
- ),
- ),
- ),
- ));
+ ],
+ ],
+ ],
+ ]);
``form_group``
~~~~~~~~~~~~~~
diff --git a/bundles/core/forms.rst b/bundles/core/forms.rst
index 72d918ac..16583ff3 100644
--- a/bundles/core/forms.rst
+++ b/bundles/core/forms.rst
@@ -14,13 +14,13 @@ typically a "terms and conditions" document. When using this type, you
additionally specify ``content_ids``, which are understood by the
:doc:`DynamicRouter <../routing/dynamic>`, along with replacement tokens::
- $form->add('terms', 'cmf_core_checkbox_url_label', array(
+ $form->add('terms', 'cmf_core_checkbox_url_label', [
'label' => 'I have seen the Team and More pages ...',
- 'content_ids' => array(
+ 'content_ids' => [
'%team%' => '/cms/content/static/team',
'%more%' => '/cms/content/static/more',
- ),
- ));
+ ],
+ ]);
The form type automatically generates the routes for the specified content and
passes the routes to the ``trans`` Twig helper for replacement in the label.
diff --git a/bundles/core/persistence.rst b/bundles/core/persistence.rst
index 9532df30..3141bf4f 100644
--- a/bundles/core/persistence.rst
+++ b/bundles/core/persistence.rst
@@ -16,13 +16,16 @@ the following to your main configuration file:
.. code-block:: yaml
- cmf_core:
- persistence:
- phpcr: ~
+ # app/config/config.yml
+ services:
+ cmf_core:
+ persistence:
+ phpcr: ~
.. code-block:: xml
+
@@ -35,11 +38,12 @@ the following to your main configuration file:
.. code-block:: php
- $container->loadFromExtension('cmf_core', array(
- 'persistence' => array(
- 'phpcr' => array(),
- ),
- ));
+ // app/config/config.php
+ $container->loadFromExtension('cmf_core', [
+ 'persistence' => [
+ 'phpcr' => [],
+ ],
+ ]);
.. _bundles-core-multilang-persisting_multilang_documents:
@@ -76,9 +80,7 @@ enforce a single translation strategy for all documents:
-
+
@@ -86,13 +88,13 @@ enforce a single translation strategy for all documents:
.. code-block:: php
- $container->loadFromExtension('cmf_core', array(
- 'persistence' => array(
- 'phpcr' => array(
+ $container->loadFromExtension('cmf_core', [
+ 'persistence' => [
+ 'phpcr' => [
'translation_strategy' => 'attribute',
- ),
- ),
- ));
+ ],
+ ],
+ ]);
.. caution::
@@ -152,17 +154,17 @@ configuration in the ``sonata_admin`` section of your project configuration:
.. code-block:: php
// app/config/config.php
- $container->loadFromExtension('sonata_admin', array(
+ $container->loadFromExtension('sonata_admin', [
// ...
- 'extensions' => array(
- 'cmf_core.admin_extension.child' => array(
- 'implements' => array(
+ 'extensions' => [
+ 'cmf_core.admin_extension.child' => [
+ 'implements' => [
'Symfony\Cmf\Bundle\CoreBundle\Model\ChildInterface',
'Doctrine\ODM\PHPCR\HierarchyInterface',
- ),
- ),
- ),
- ));
+ ],
+ ],
+ ],
+ ]);
See the `Sonata Admin extension documentation`_ for more information.
@@ -209,16 +211,16 @@ configuration in the ``sonata_admin`` section of your project configuration:
.. code-block:: php
// app/config/config.php
- $container->loadFromExtension('sonata_admin', array(
+ $container->loadFromExtension('sonata_admin', [
// ...
- 'extensions' => array(
- 'cmf_core.admin_extension.translatable' => array(
- 'implements' => array(
+ 'extensions' => [
+ 'cmf_core.admin_extension.translatable' => [
+ 'implements' => [
'Symfony\Cmf\Bundle\CoreBundle\Translatable\TranslatableInterface',
- ),
- ),
- ),
- ));
+ ],
+ ],
+ ],
+ ]);
See the `Sonata Admin extension documentation`_ for more information.
diff --git a/bundles/core/publish_workflow.rst b/bundles/core/publish_workflow.rst
index 3ca36e04..cb43f41e 100644
--- a/bundles/core/publish_workflow.rst
+++ b/bundles/core/publish_workflow.rst
@@ -78,11 +78,11 @@ given to editors. The default name of the role is ``ROLE_CAN_VIEW_NON_PUBLISHED`
.. code-block:: php
// app/config/security.php
- $container->loadFromExtension('security', array(
- 'role_hierarchy' => array(
+ $container->loadFromExtension('security', [
+ 'role_hierarchy' => [
'ROLE_EDITOR' => 'ROLE_CAN_VIEW_NON_PUBLISHED',
- ),
- ));
+ ],
+ ]);
Once a user with ``ROLE_EDITOR`` is logged in - meaning there is a firewall in place for
the path in question - they will have the permission to view unpublished content as well::
@@ -305,7 +305,7 @@ you can lower the priority of those voters:
.. code-block:: yaml
services:
- security.publishable_voter:
+ app.publishable_voter:
class: "AppBundle\Security\PublishableVoter"
tags:
- { name: cmf_published_voter, priority: 30 }
@@ -314,7 +314,7 @@ you can lower the priority of those voters:
-
@@ -327,10 +327,10 @@ you can lower the priority of those voters:
$container
->register(
- 'security.publishable_voter',
+ 'app.publishable_voter',
'AppBundle\Security\PublishableVoter'
)
- ->addTag('cmf_published_voter', array('priority' => 30))
+ ->addTag('cmf_published_voter', ['priority' => 30])
;
The workflow checker will create an
@@ -413,21 +413,21 @@ configuration in the ``sonata_admin`` section of your project configuration:
.. code-block:: php
// app/config/config.php
- $container->loadFromExtension('sonata_admin', array(
+ $container->loadFromExtension('sonata_admin', [
// ...
- 'extensions' => array(
- 'cmf_core.admin_extension.publish_workflow.publishable' => array(
- 'implements' => array(
+ 'extensions' => [
+ 'cmf_core.admin_extension.publish_workflow.publishable' => [
+ 'implements' => [
'Symfony\Cmf\Bundle\CoreBundle\PublishWorkflow\PublishableInterface',
- ),
- ),
- 'cmf_core.admin_extension.publish_workflow.time_period' => array(
- 'implements' => array(
+ ],
+ ],
+ 'cmf_core.admin_extension.publish_workflow.time_period' => [
+ 'implements' => [
'Symfony\Cmf\Bundle\CoreBundle\PublishWorkflow\PublishTimePeriodInterface',
- ),
- ),
- ),
- ));
+ ],
+ ],
+ ],
+ ]);
See the `Sonata Admin extension documentation`_ for more information.
diff --git a/bundles/core/templating.rst b/bundles/core/templating.rst
index f51d8b74..fe4819c7 100644
--- a/bundles/core/templating.rst
+++ b/bundles/core/templating.rst
@@ -132,7 +132,7 @@ Code examples
next
{% endif %}
- {% for news in cmf_children(parent=cmfMainContent, class='Acme\\DemoBundle\\Document\\NewsItem')|reverse %}
+ {% for news in cmf_children(parent=cmfMainContent, class='AppBundle\\Document\\NewsItem')|reverse %}
{{ news.title }} ({{ news.publishStartDate | date('Y-m-d') }})
{% endfor %}
@@ -185,7 +185,7 @@ Code examples
$app->getRequest()->attributes->get('_route_params'),
array_merge(
$app->getRequest()->query->all(),
- array('_locale' => 'de')
+ ['_locale' => 'de']
)
)
?>">DE
@@ -197,7 +197,7 @@ Code examples
$app->getRequest()->attributes->get('_route_params'),
array_merge(
$app->getRequest()->query->all(),
- array('_locale' => 'fr')
+ ['_locale' => 'fr']
)
)
?>">FR
@@ -208,7 +208,7 @@ Code examples
When you use the ``class`` argument, do not forget that Twig will
simply *ignore* single backslashes. If you would write
- ``Acme\DemoBundle\Document\NewsItem``, this will make the cmf look
- for the class AcmeDemoBundleDocumentNewsItem which will result in an
+ ``AppBundle\Document\NewsItem``, this will make the cmf look
+ for the class ``AppBundleDocumentNewsItem`` which will result in an
empty list. What you need to write in the template is
- ``Acme\\DemoBundle\\Document\\NewsItem``.
+ ``AppBundle\\Document\\NewsItem``.