From 2eab56fe805ecfec01049b031664441a9f021563 Mon Sep 17 00:00:00 2001 From: Kristian Zondervan Date: Fri, 23 Nov 2012 10:26:49 +0100 Subject: [PATCH] Routing: getRouteKey additions --- bundles/routing-extra.rst | 3 ++- components/routing.rst | 10 +++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/bundles/routing-extra.rst b/bundles/routing-extra.rst index 3bbc98f5..6c3cb4f0 100644 --- a/bundles/routing-extra.rst +++ b/bundles/routing-extra.rst @@ -266,7 +266,8 @@ redirections and locales. Notes: -* RouteObjectInterface: The provided documents implement this interface to map content to routes +* RouteObjectInterface: The provided documents implement this interface to map content to routes and to (optional) provide + a custom route name instead of the symfony core compatible route name. * Redirections: This bundle provides a RedirectController. TODO: see DependencyInjection/Configuration.php of this bundle. I could not figure out how to set diff --git a/components/routing.rst b/components/routing.rst index 6a1c9510..c9fae910 100644 --- a/components/routing.rst +++ b/components/routing.rst @@ -79,7 +79,15 @@ The match method of the DynamicRouter does the following steps RouteObjectInterface ~~~~~~~~~~~~~~~~~~~~ -Routes that implement this interface are linked to a content document. +Routes that implement this interface can be linked to a content document using +the ``getRouteContent`` method. If non-null, this content is passed to the +controller. If there is no specific content for this route this may return null. + +Furthermore, routes that implement this interface can also provide a custom route +name. The key returned by ``getRouteKey`` will be used as route name instead of +the Symfony core compatible route name and can contain any characters. This allows +you, for example, to set a path as the route name. + All routes still need to extend the base class ``Symfony\Component\Routing\Route`` Redirections