Feature #26688
Magic Object Routes
| Status: | Closed | Start date: | 2011-05-06 | |
|---|---|---|---|---|
| Priority: | Should have | Due date: | ||
| Assigned To: | Bastian Waidelich | % Done: | 0% |
|
| Category: | MVC - Routing | |||
| Target version: | - | |||
| PHP Version: | Complexity: | |||
| Has patch: |
Description
I'm dreaming of having a more intuitive way of defining default object-controller routes like this:
-
name: 'Ticket'
uriPattern: 'tickets/{ticket}(.{@format})'
defaults:
@package: Guruhelp
@controller: Ticket
@action: show
@format: html
routeParts:
ticket:
handler: F3\Guruhelp\Routing\TicketRoutePartHandler
Should look like this:
-
name: 'Ticket'
uriPattern: 'tickets/{ticket}(.{@format})'
defaults:
@package: Guruhelp
@controller: Ticket
@action: show
@format: html
And the route configuration should autodetect what identifier to use (uuid or autoincrement integer values, depending on the model-aspect-definition) for resolving the object. Routes like tickets/9fadfc1e-c268-40f1-8190-547448d0d4b8.xml should work "out-of-the-box".
Today I have to use such an ugly route:
-
name: 'Ticket detail'
uriPattern: 'tickets/show(.{@format})'
defaults:
@package: Guruhelp
@controller: Ticket
@action: show
@format: html
..that resolves in something like this: tickets/show?ticket[__identity]=5f1e5e06-2430-45be-addf-4b5236d27229
Related issues
History
#1 Updated by Bastian Waidelich about 4 years ago
- Status changed from New to Closed
Thanks for reporting Martin, but there is a ticket for that already. I'll close this one to avoid confusion.
And, promised, magic object routes will come very soon! ;)