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

Commit 5090b09

Browse files
committed
Merge pull request #729 from symfony-cmf/route-object-interface
better explain the getRouteKey method
2 parents 8910d96 + 0f044d9 commit 5090b09

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

book/routing.rst

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -337,8 +337,8 @@ as soon as you add any other configuration to the ``dynamic`` entry.
337337
This example uses a controller which is defined as a service. You can also
338338
configure a controller by using a fully qualified class name:
339339
``CmfContentBundle:Content:index``.
340-
341-
For more information on using controllers as a service read cook book
340+
341+
For more information on using controllers as a service read cook book
342342
section `How to Define Controllers as Services`_
343343

344344
.. note::
@@ -362,9 +362,12 @@ automatically passed to the Controller as the ``contentDocument`` method paramet
362362
Note that a Route can implement the above mentioned interface but still not
363363
return any model instance, in which case no associated object will be provided.
364364

365-
Furthermore, Routes that implement this interface can also have a custom Route
366-
name, instead of the default Symfony core compatible name, and can contain
367-
any characters. This allows you, for example, to set a path as the route name.
365+
Furthermore, Routes that implement this interface can also provide their own
366+
name with the ``getRouteKey`` method. For normal Symfony routes, the name is
367+
only known from their key in the ``RouteCollection`` collection hashmap. In the
368+
CMF, it is possible to use route documents outside of collections, and thus
369+
useful to have routes provide their name. The PHPCR routes for example return
370+
the repository path when this method is called.
368371

369372
Redirects
370373
---------

0 commit comments

Comments
 (0)