Skip to content

linking to the cmf routing component #2186

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

Closed
lsmith77 opened this issue Jan 27, 2013 · 11 comments
Closed

linking to the cmf routing component #2186

lsmith77 opened this issue Jan 27, 2013 · 11 comments
Labels
actionable Clear and specific issues ready for anyone to take them. Routing

Comments

@lsmith77
Copy link
Contributor

wondering if we should link to the cmf routing component from the routing component docs?

specifically it might make sense to mention the ChainRouter:
http://symfony.com/doc/master/cmf/components/routing.html#chainrouter

and the DyamicRouter:
http://symfony.com/doc/master/cmf/components/routing.html#dynamic-router

note the component atm supports 2.1 and 2.2

wdyt?

@weaverryan
Copy link
Member

I'm +1 for it - the question is where? There is no cookbook article currently on routing from a dynamic resource, so I think we should:

  1. Boostrap a cookbook article called something like "How to Load Routes Dynamically or from a Database". This would give a basic example of the routing.loader tag usage, which is currently only covered here: http://symfony.com/doc/current/reference/dic_tags.html#routing-loader

  2. Add a second section in that article (and we can also "tease it" higher up), which mentions the CMF Router and how it has built-in solutions for things like this with a link to its docs.

I think all of this would be very nice!

@lsmith77
Copy link
Contributor Author

sounds like a plan! /cc @dbu

@dbu
Copy link
Contributor

dbu commented Mar 26, 2013

yeah. the plan is good. now somebody needs to do it :-)

i think when you load routes from the database the cmf RoutingExtraBundle is really the tool, so i would not see to explain that example. but you could have even more specific routing, for example when integrating a legacy framework, where writing your own router implementation makes more sense.

i'll keep this in mind and maybe write something when i find time. have quite a backlog of things that should be done on the cmf docs themselves, however.

@trsteel88
Copy link
Contributor

+1 for a cookbook for dynamic routes with doctrine ORM

@wouterj
Copy link
Member

wouterj commented Jun 23, 2013

do you have any plans on this @dbu or @lsmith77 ? Otherwise I'll start working on this one

@lsmith77
Copy link
Contributor Author

well there is a WIP to add ORM support into the RoutingBundle:
symfony-cmf/routing-bundle#116

however a more expanded cookbook entry to explain how to support a legacy routing table would of course be very welcome but i am not aware of plans to write one.

@dbu
Copy link
Contributor

dbu commented Jun 24, 2013

i did not forget about this, but did not find time to do it. the gist should be:

  • if you want to store routes in the db, use cmf RouteBundle.
  • if you have routes in a custom format in the db (or some other external source) and want to provide them, use DynamicRouter with a custom RouteProvider impl
  • if you have a totally custom thing, use the ChainRouter of cmf RouteBundle and implement your own router

if you have time to write it, great! ping me on the PR so i can give you feedback.

@wouterj
Copy link
Member

wouterj commented Jun 24, 2013

you properbly mean the ChainRouter of the cmf Routing component, @dbu ?

@dbu
Copy link
Contributor

dbu commented Jun 24, 2013

well, it depends. if you use the bundle, you can tag your router to have it automatically added into the chain. without the bundle indeed you can bootstrap your own chain router and add your router to it. but you are right in the sense that there is no ChainRouter class in the RoutingBundle, we did not need anything symfony framework specific there.

@javiereguiluz
Copy link
Member

Both the dynamic (http://symfony.com/doc/master/cmf/components/routing/dynamic.html) and the chain router (http://symfony.com/doc/master/cmf/components/routing/chain.html) are documented and linked from the Symfony Documentation section.

@weaverryan @wouterj this issue can be safely closed.

@wouterj
Copy link
Member

wouterj commented Jun 4, 2014

... linked from the Symfony Documentation section.

Where did you find such a link? I can't find one in the routing book, cookbook and components sections.

Afaics, the points proposed here by @weaverryan are not yet done, that's why I left this open:

  1. Boostrap a cookbook article called something like "How to Load Routes Dynamically or from a Database". This would give a basic example of the routing.loader tag usage, which is currently only covered here: http://symfony.com/doc/current/reference/dic_tags.html#routing-loader

  2. Add a second section in that article (and we can also "tease it" higher up), which mentions the CMF Router and how it has built-in solutions for things like this with a link to its docs.

weaverryan added a commit that referenced this issue Feb 16, 2016
This PR was merged into the 2.3 branch.

Discussion
----------

mention routing from the database

| Q             | A
| ------------- | ---
| Doc fix?      | no
| New docs?     | yes
| Applies to    | 2.3+
| Fixed tickets | #2186, relates to #5709

if we merge #6020, we might want to put this as subsection of the extending_routing section

Commits
-------

c458431 mention routing from the database
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
actionable Clear and specific issues ready for anyone to take them. Routing
Projects
None yet
Development

No branches or pull requests

6 participants