-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
mention CMF ChainRouter, restructure documentation for extending routing #6020
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Extending the Routing System | ||
============================ | ||
|
||
The routing system has several extension points: | ||
|
||
* You can use the ``@ParamConverter`` mechanism of FrameworkExtraBundle_ | ||
to convert controller arguments into objects. | ||
* You can write :doc:`custom route loaders <custom_route_loader>`; | ||
* You can write your own ``Router`` instance and | ||
:doc:`combine several routers <multiple_routers>`; | ||
* Some bundles overwrite core routing services to alter the route loading | ||
process, e.g. JmsI18nRoutingBundle_. | ||
|
||
.. _FrameworkExtraBundle: https://symfony.com/doc/current/bundles/SensioFrameworkExtraBundle/annotations/converters.html | ||
.. _JMSI18nRoutingBundle: https://github.com/schmittjoh/JMSI18nRoutingBundle | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should link here: http://jmsyst.com/bundles/JMSI18nRoutingBundle - the GitHub page just points you there. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,8 @@ Routing | |
redirect_in_config | ||
method_parameters | ||
service_container_parameters | ||
custom_route_loader | ||
redirect_trailing_slash | ||
extra_information | ||
extending_routing | ||
custom_route_loader | ||
multiple_routers | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not sure if its ok to add multiple levels of navigation here, but i think it would make sense. also not sure if this is the right syntax for rst. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This doesn't work in the table of contents. You will probably want to update There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. there is no /cookbook/routing/map.rst.inc file i think. do you have an idea how we should do this? or should we give up on making this a sub-group and just cram it into one article? or a series that repeat part of the title: "Extending Routing: ..."? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh sorry about that. :( The right file is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yep, found it :-)
but we need to solve the general question how we organize the
information, whether we compact that into one article or something else.
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
.. index:: | ||
single: Routing; Multiple Routers | ||
|
||
Using the Symfony CMF ChainRouter to Combine Multiple Routers | ||
============================================================= | ||
|
||
The Symfony CMF ``ChainRouter`` allows to use more than one router. A main | ||
use case is to keep the :doc:`default symfony routing system </book/routing>` | ||
available when writing a custom router. | ||
|
||
.. caution:: | ||
|
||
If you simply need a way to load routes determined in a different | ||
way, using :doc:`a custom route loader <custom_route_loader>` is | ||
simpler than writing your own controller. | ||
Writing a custom controller is justified when the routes can not be | ||
statically determined. | ||
|
||
TODO: a bit of code examples? | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i need to wrap this up, if we agree that this PR is going in the right direction. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the overview of the subsection on extending the routing, trying to give an overview.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the idea, but I think adding articles to the cookbook and putting "how do I...?" entires in the cookbook TOC is much more useful - e.g. potentially "How do I convert controller arguments to objects" - which would be something very short pointing to FrameworkExtraBundle. That's arguably overkill... but more findable.