Feature #26688

Magic Object Routes

Added by Martin Br├╝ggemann over 10 years ago. Updated over 10 years ago.

Status:
Closed
Priority:
Should have
Category:
MVC - Routing
Target version:
-
Start date:
2011-05-06
Due date:
% Done:

0%

Estimated time:
PHP Version:
Has patch:
Complexity:

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

Is duplicate of TYPO3.Flow - Feature #8736: Implement generic Identity RoutePartHandlerResolvedBastian Waidelich

Actions

Also available in: Atom PDF