-
Notifications
You must be signed in to change notification settings - Fork 76
[RFC] Provide event for collecting routes from bundles #343
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
Comments
is the idea to dynamically decide which routing files to load? i am not sure if this would be in the scope of the cmf routing. our goal is to load specific routes on demand, to handle large amounts of routes that would be too much to all load at once. symfony itself knows custom route loaders: http://symfony.com/doc/current/cookbook/routing/custom_route_loader.html - i think it would make more sense to use that instead. you could write a custom loader that triggers an event if you want to, to make things simpler than they currently are done in FOSRestBundle or SonataAdminBundle. this could be a separate RouteAutoLoaderBundle or something like that. |
maybe not 100% dynamically, maybe dynamically on cache warming pass. Idea register routing from bundles without editing configuration (config.yml, routing.yml). |
i think the idea makes sense, but i don't think it fits into the scope
of this bundle. the dynamic router does not use the normal route
collection of the core symfony routing.
|
Suggest where better locate it. Inside separate bundle or inside core or ...? |
I've opened ticket here because this is feature for cms/cmf - install and enable module without config changes |
i think @xabbuh introduced the feature to simply tag a service as route provider to simplify the setup. not sure if an event would fit into symfony core as well, or if its considered not enough additional value to justify adding the code. the symfony-cmf is not so much about simplifying plugging bundles, its more about working with content data. but i came across other projects that try to make bundles more "auto-pluggable" - unfortunately don't remember the names of those. |
@dbu I think you are talking about the feature Ryan introduced in symfony/symfony#15742. Unfortunately, this isn't documented yet (see symfony/symfony-docs#5747). |
indeed, thanks and sorry for the ping xabbuh. @weaverryan do you have any input for @Koc , do you feel an event could fit into core symfony as an addition to the service tagging or is your new feature an alternative solution to the event based idea? |
IIRC, this feature has been rejected from Core several times, as order is very important for routing (while it isn't for bundle registration). Allowing bundles to register routes means things can be messed up pretty badly because the first route that matches is taken. Also, this removes the ability to add a prefix for bundle routes. In any way, this feature doesn't fit in the scope of the CmfRoutingBundle, so I think this issue can be closed. |
It would be useful if we can add route resources files when enabling bundle in kernel with zero-config changes.
See https://github.com/modera/ModeraRoutingBundle/blob/master/Routing/Loader.php and https://github.com/modera/ModeraRoutingBundle/blob/master/README.md for similar approach
The text was updated successfully, but these errors were encountered: