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

Commit e5a13c6

Browse files
committed
Merge pull request #47 from krizon/routing-additions
Routing: getRouteKey additions
2 parents 8bd2d1e + 2eab56f commit e5a13c6

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

bundles/routing-extra.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,8 @@ redirections and locales.
266266

267267
Notes:
268268

269-
* RouteObjectInterface: The provided documents implement this interface to map content to routes
269+
* RouteObjectInterface: The provided documents implement this interface to map content to routes and to (optional) provide
270+
a custom route name instead of the symfony core compatible route name.
270271
* Redirections: This bundle provides a RedirectController.
271272

272273
TODO: see DependencyInjection/Configuration.php of this bundle. I could not figure out how to set

components/routing.rst

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,15 @@ The match method of the DynamicRouter does the following steps
7979
RouteObjectInterface
8080
~~~~~~~~~~~~~~~~~~~~
8181

82-
Routes that implement this interface are linked to a content document.
82+
Routes that implement this interface can be linked to a content document using
83+
the ``getRouteContent`` method. If non-null, this content is passed to the
84+
controller. If there is no specific content for this route this may return null.
85+
86+
Furthermore, routes that implement this interface can also provide a custom route
87+
name. The key returned by ``getRouteKey`` will be used as route name instead of
88+
the Symfony core compatible route name and can contain any characters. This allows
89+
you, for example, to set a path as the route name.
90+
8391
All routes still need to extend the base class ``Symfony\Component\Routing\Route``
8492

8593
Redirections

0 commit comments

Comments
 (0)