Skip to content

Ability to load routes from objects/services #5747

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
xabbuh opened this issue Oct 1, 2015 · 8 comments
Closed

Ability to load routes from objects/services #5747

xabbuh opened this issue Oct 1, 2015 · 8 comments
Labels
hasPR A Pull Request has already been submitted for this issue. Routing
Milestone

Comments

@xabbuh
Copy link
Member

xabbuh commented Oct 1, 2015

see symfony/symfony#15742

@dbu
Copy link
Contributor

dbu commented Oct 16, 2015

@weaverryan any chance you work on this soon? would love to mention it in my "routing under the hood" talk at the symfony user group meeting in zurich next week... i see what you did, but am not sure how one would actually go about using it in a project.

@dbu
Copy link
Contributor

dbu commented Oct 16, 2015

can i just say resource: service_id in my routing file?

@wouterj
Copy link
Member

wouterj commented Oct 17, 2015

@dbu yes, like this:

admin_routes:
    resource: 'admin_route_loader:loadRoutes'
    type: service # <-- very important

This calls the loadRoutes() method of the admin_route_loader service

@weaverryan
Copy link
Member

Thanks Wouter - it's exactly as you said :).

I probably won't doc this before then, so hopefully this will get you going - happy you're chatting about it!

@weaverryan
Copy link
Member

We don't cover the route "loaders" anywhere now, so I'm not sure where to put this. Maybe a tiny cookbook article called "How to load routes from a Service"?

@nicoschoenmaker
Copy link
Contributor

Just found out about this feature, works pretty nicely!

@weaverryan I'd expect to find a reference in this guide. That is the one I found when searching for how to load routes from other sources (like from the db).

@dbu
Copy link
Contributor

dbu commented Feb 16, 2016

@nicoschoenmaker want to do a pull request to add it to that cookbook article? (against the 2.8 branch)

@javiereguiluz javiereguiluz added the hasPR A Pull Request has already been submitted for this issue. label Jan 22, 2018
javiereguiluz added a commit that referenced this issue Jan 24, 2018
…ereguiluz)

This PR was merged into the 2.8 branch.

Discussion
----------

Documented how to load routes from objects/services

This fixes #5747.

Commits
-------

84777b2 Documented how to load routes from objects/services
@javiereguiluz
Copy link
Member

Fixed by #9101.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hasPR A Pull Request has already been submitted for this issue. Routing
Projects
None yet
Development

No branches or pull requests

6 participants