8000 Routing: Working with entities · Issue #22161 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Routing: Working with entities #22161

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
ScreamingDev opened this issue Mar 25, 2017 · 4 comments
Closed

Routing: Working with entities #22161

ScreamingDev opened this issue Mar 25, 2017 · 4 comments

Comments

@ScreamingDev
Copy link
ScreamingDev commented Mar 25, 2017
Q A
Bug report? no
Feature request? yes
BC Break report? no
RFC? yes/no/dunno
Symfony version 3.2

Routing works like:

wallet_read:
  path: /wallet/{id}.{_format}

Would be nice to have that a bit more intelligent like

wallet_read:
  path: /wallet/{wallet.id}/{wallet.title}.{_format}

So that URL generator like in Twig receive the entity and does the rest of the magic:

path('wallet_show', {wallet: wallet})

How about that?

@linaori
Copy link
Contributor
linaori commented Mar 25, 2017

While this doesn't work exactly the way you want it, it does allow objects as route arguments: https://github.com/iltar/http-bundle

@javiereguiluz
Copy link
Member
javiereguiluz commented Mar 26, 2017

@sourcerer-mike thanks for your proposal. Sadly, I must close it as "duplicated" because we have received the same proposal in #21435, #10395, #5999, #11177 and #2288.

@zmitic
Copy link
zmitic commented Jan 10, 2018

@ScreamingDev Take a look at this bundle, works very similar to what you want with just one extra annotation:

https://github.com/zmitic/rewire-bundle

@linaori
Copy link
Contributor
linaori commented Jan 10, 2018

@zmitic interestingly enough, your objects when creating routes does almost the same as my bundle. Seems like it could be enhanced using my bundle for that part

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants
0