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

Update master from 1.2 #728

Merged
merged 10 commits into from
Jan 2, 2016
10 changes: 10 additions & 0 deletions book/routing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,15 @@ Notice that ``enabled: true`` is no longer present. It's only required if no
other configuration parameter is provided. The router is automatically enabled
as soon as you add any other configuration to the ``dynamic`` entry.

.. note::

This example uses a controller which is defined as a service. You can also
configure a controller by using a fully qualified class name:
``CmfContentBundle:Content:index``.

For more information on using controllers as a service read cook book
section `How to Define Controllers as Services`_

.. note::

Internally, the routing component maps these configuration options to
Expand Down Expand Up @@ -522,3 +531,4 @@ For more information on the Routing component of Symfony CMF, please refer to:
.. _`Doctrine ORM`: http://www.doctrine-project.org/projects/orm.html
.. _`PHPCR-ODM`: http://www.doctrine-project.org/projects/phpcr-odm.html
.. _`Routing`: http://symfony.com/doc/current/components/routing/introduction.html
.. _`How to Define Controllers as Services`: http://symfony.com/doc/current/cookbook/controller/service.html
20 changes: 20 additions & 0 deletions bundles/menu/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,26 @@ The Sonata admin class to use for the menu node.
When editing a node, this setting will cause the Sonata admin breadcrumb to
include ancestors of the node being edited.

content_url_generator
~~~~~~~~~~~~~~~~~~~~~

.. versionadded:: 1.2
This option was introduced in version 1.2.0. Prior to 1.2, this option is
not available and the default service ``router`` is hardcoded.

**type**: ``string`` **default**: ``router``

With this option, you can change what router should be used for generating
URLs from menu nodes of type "content".

allow_empty_items
~~~~~~~~~~~~~~~~~

**type**: ``boolean`` **default**: ``false``

Whether menu nodes without URL should be hidden or rendered as text without a
link.

Admin Extensions
----------------

Expand Down
36 changes: 27 additions & 9 deletions bundles/menu/menu_factory.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,17 @@ A menu item should have a URL associated with it. The CMF provides the
from the ``content`` and ``routeParameters`` options when using the
:ref:`dynamic router <bundles-routing-dynamic-generator>`.

The ``content`` option, if specified, must contain a class which implements
the ``RouteReferrersInterface``, see the :ref:`dynamic router
<bundles-routing-dynamic-generator>` documentation for more information.
The ``content`` option, if specified, must contain something that the content
URL generator can work with. When using the :ref:`dynamic router
<bundles-routing-dynamic-generator>`, this needs to be a class implementing
the ``RouteReferrersInterface``. You can alternatively specify a custom
``UrlGeneratorInterface`` with the ``content_url_generator`` configuration
option.

.. versionadded:: 1.2
The ``content_url_generator`` option was introduced in CmfMenuBundle 1.2.0.
Prior to 1.2, the default service ``router`` was hardcoded to generate URLs
from content.

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

* ``null``: If the value is ``null`` (or the options is not set) then the link
type is determined automatically by looking at each of the ``uri``, ``route`` and
``content`` options and using the first one which is non-null.
type is determined automatically by looking at each of the ``uri``, ``route``
and ``content`` options and using the first one which is non-null.
* **uri**: Use the URI provided by the ``uri`` option.
* **route**: Generate a URL using the route named by the ``route`` option
and the parameters provided by the ``routeParameters`` option.
* **content**: Generate a URL by passing the ``RouteReferrersInterface``
instance provided by the ``content`` option to the router using any
parameters provided by the ``routeParameters`` option.
* **content**: Generate a URL by passing the value of the ``content`` option to
the content URL generator, using any parameters provided by the
``routeParameters`` option.

Menu Nodes without URL
~~~~~~~~~~~~~~~~~~~~~~

A menu node document might not have a URL, when that information was never set
or it points to a content that has been deleted meanwhile. In that case, there
are two options: The menu node can be skipped, or it can be rendered as text
without link. By default, the node is skipped.

You can set ``cmf_menu.allow_empty_items`` to true to render nodes without URL.

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

.. versionadded:: 1.1
The ``MenuContentVoter`` was added in CmfMenuBundle 1.1.
The ``MenuContentVoter`` was introduced in CmfMenuBundle 1.1.

The ``MenuContentVoter`` decides that a menu node is not published if the
content it is pointing to is not published.
Expand Down
5 changes: 5 additions & 0 deletions bundles/phpcr_odm/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,11 @@ Use a custom factory class for Jackalope objects.
If set to ``false``, skip initial check whether repository exists. You will
only notice connectivity problems on the first attempt to use the repository.

.. versionadded:: 1.3.1
In version 1.2 and 1.3.0 of the DoctrinePhpcrBundle, the default value depends
on ``%kernel.debug%``. We recommend setting the value to false to avoid
bootstraping issues.

``jackalope.disable_stream_wrapper``
....................................

Expand Down
1 change: 0 additions & 1 deletion tutorial/auto-routing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@ You can now proceed to mapping your documents, create the following in your
</mapping>

<mapping class="Acme\BasicCmsBundle\Document\Post"
extend="Acme\BasicCmsBundle\Document\Page"
uri-schema="/post/{date}/{title}">

<token-provider token="date" name="content_datetime">
Expand Down