diff --git a/book/routing.rst b/book/routing.rst index 9e773756..fbff4057 100644 --- a/book/routing.rst +++ b/book/routing.rst @@ -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 @@ -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 diff --git a/bundles/menu/configuration.rst b/bundles/menu/configuration.rst index 285f7015..f191f52f 100644 --- a/bundles/menu/configuration.rst +++ b/bundles/menu/configuration.rst @@ -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 ---------------- diff --git a/bundles/menu/menu_factory.rst b/bundles/menu/menu_factory.rst index fe858a5d..92989b59 100644 --- a/bundles/menu/menu_factory.rst +++ b/bundles/menu/menu_factory.rst @@ -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 `. -The ``content`` option, if specified, must contain a class which implements -the ``RouteReferrersInterface``, see the :ref:`dynamic router -` 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 +`, 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. @@ -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 ---------------- @@ -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. diff --git a/bundles/phpcr_odm/configuration.rst b/bundles/phpcr_odm/configuration.rst index a9dcc4dd..03d056d1 100644 --- a/bundles/phpcr_odm/configuration.rst +++ b/bundles/phpcr_odm/configuration.rst @@ -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`` .................................... diff --git a/tutorial/auto-routing.rst b/tutorial/auto-routing.rst index a23d47f6..29b28494 100644 --- a/tutorial/auto-routing.rst +++ b/tutorial/auto-routing.rst @@ -186,7 +186,6 @@ You can now proceed to mapping your documents, create the following in your