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

Commit 3fb79e4

Browse files
committed
Merge pull request #728 from symfony-cmf/update-master-from-1.2
Update master from 1.2
2 parents 84b1d9b + a59be86 commit 3fb79e4

File tree

5 files changed

+62
-10
lines changed

5 files changed

+62
-10
lines changed

book/routing.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,15 @@ Notice that ``enabled: true`` is no longer present. It's only required if no
332332
other configuration parameter is provided. The router is automatically enabled
333333
as soon as you add any other configuration to the ``dynamic`` entry.
334334

335+
.. note::
336+
337+
This example uses a controller which is defined as a service. You can also
338+
configure a controller by using a fully qualified class name:
339+
``CmfContentBundle:Content:index``.
340+
341+
For more information on using controllers as a service read cook book
342+
section `How to Define Controllers as Services`_
343+
335344
.. note::
336345

337346
Internally, the routing component maps these configuration options to
@@ -522,3 +531,4 @@ For more information on the Routing component of Symfony CMF, please refer to:
522531
.. _`Doctrine ORM`: http://www.doctrine-project.org/projects/orm.html
523532
.. _`PHPCR-ODM`: http://www.doctrine-project.org/projects/phpcr-odm.html
524533
.. _`Routing`: http://symfony.com/doc/current/components/routing/introduction.html
534+
.. _`How to Define Controllers as Services`: http://symfony.com/doc/current/cookbook/controller/service.html

bundles/menu/configuration.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,26 @@ The Sonata admin class to use for the menu node.
183183
When editing a node, this setting will cause the Sonata admin breadcrumb to
184184
include ancestors of the node being edited.
185185

186+
content_url_generator
187+
~~~~~~~~~~~~~~~~~~~~~
188+
189+
.. versionadded:: 1.2
190+
This option was introduced in version 1.2.0. Prior to 1.2, this option is
191+
not available and the default service ``router`` is hardcoded.
192+
193+
**type**: ``string`` **default**: ``router``
194+
195+
With this option, you can change what router should be used for generating
196+
URLs from menu nodes of type "content".
197+
198+
allow_empty_items
199+
~~~~~~~~~~~~~~~~~
200+
201+
**type**: ``boolean`` **default**: ``false``
202+
203+
Whether menu nodes without URL should be hidden or rendered as text without a
204+
link.
205+
186206
Admin Extensions
187207
----------------
188208

bundles/menu/menu_factory.rst

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,17 @@ A menu item should have a URL associated with it. The CMF provides the
2626
from the ``content`` and ``routeParameters`` options when using the
2727
:ref:`dynamic router <bundles-routing-dynamic-generator>`.
2828

29-
The ``content`` option, if specified, must contain a class which implements
30-
the ``RouteReferrersInterface``, see the :ref:`dynamic router
31-
<bundles-routing-dynamic-generator>` documentation for more information.
29+
The ``content`` option, if specified, must contain something that the content
30+
URL generator can work with. When using the :ref:`dynamic router
31+
<bundles-routing-dynamic-generator>`, this needs to be a class implementing
32+
the ``RouteReferrersInterface``. You can alternatively specify a custom
33+
``UrlGeneratorInterface`` with the ``content_url_generator`` configuration
34+
option.
35+
36+
.. versionadded:: 1.2
37+
The ``content_url_generator`` option was introduced in CmfMenuBundle 1.2.0.
38+
Prior to 1.2, the default service ``router`` was hardcoded to generate URLs
39+
from content.
3240

3341
URL generation is absolute or relative, depending on the boolean value of the
3442
``routeAbsolute`` option.
@@ -44,14 +52,24 @@ of the three URL generation techniques to use.
4452
The values for this options can be one of the following:
4553

4654
* ``null``: If the value is ``null`` (or the options is not set) then the link
47-
type is determined automatically by looking at each of the ``uri``, ``route`` and
48-
``content`` options and using the first one which is non-null.
55+
type is determined automatically by looking at each of the ``uri``, ``route``
56+
and ``content`` options and using the first one which is non-null.
4957
* **uri**: Use the URI provided by the ``uri`` option.
5058
* **route**: Generate a URL using the route named by the ``route`` option
5159
and the parameters provided by the ``routeParameters`` option.
52-
* **content**: Generate a URL by passing the ``RouteReferrersInterface``
53-
instance provided by the ``content`` option to the router using any
54-
parameters provided by the ``routeParameters`` option.
60+
* **content**: Generate a URL by passing the value of the ``content`` option to
61+
the content URL generator, using any parameters provided by the
62+
``routeParameters`` option.
63+
64+
Menu Nodes without URL
65+
~~~~~~~~~~~~~~~~~~~~~~
66+
67+
A menu node document might not have a URL, when that information was never set
68+
or it points to a content that has been deleted meanwhile. In that case, there
69+
are two options: The menu node can be skipped, or it can be rendered as text
70+
without link. By default, the node is skipped.
71+
72+
You can set ``cmf_menu.allow_empty_items`` to true to render nodes without URL.
5573

5674
Publish Workflow
5775
----------------
@@ -61,7 +79,7 @@ visible by use of the :doc:`publish workflow checker
6179
<../core/publish_workflow>`.
6280

6381
.. versionadded:: 1.1
64-
The ``MenuContentVoter`` was added in CmfMenuBundle 1.1.
82+
The ``MenuContentVoter`` was introduced in CmfMenuBundle 1.1.
6583

6684
The ``MenuContentVoter`` decides that a menu node is not published if the
6785
content it is pointing to is not published.

bundles/phpcr_odm/configuration.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,11 @@ Use a custom factory class for Jackalope objects.
165165
If set to ``false``, skip initial check whether repository exists. You will
166166
only notice connectivity problems on the first attempt to use the repository.
167167

168+
.. versionadded:: 1.3.1
169+
In version 1.2 and 1.3.0 of the DoctrinePhpcrBundle, the default value depends
170+
on ``%kernel.debug%``. We recommend setting the value to false to avoid
171+
bootstraping issues.
172+
168173
``jackalope.disable_stream_wrapper``
169174
....................................
170175

tutorial/auto-routing.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,6 @@ You can now proceed to mapping your documents, create the following in your
186186
</mapping>
187187
188188
<mapping class="Acme\BasicCmsBundle\Document\Post"
189-
extend="Acme\BasicCmsBundle\Document\Page"
190189
uri-schema="/post/{date}/{title}">
191190
192191
<token-provider token="date" name="content_datetime">

0 commit comments

Comments
 (0)