Feature #8736

Implement generic Identity RoutePartHandler

Added by Bastian Waidelich almost 12 years ago. Updated over 10 years ago.

Status:
Resolved
Priority:
Should have
Category:
MVC - Routing
Start date:
Due date:
% Done:

100%

Estimated time:
PHP Version:
Has patch:
Complexity:

Description

We should provide a generic RoutePart handler, that allows to match/resolve Identities. This should be configurable through the "options" setting that was implemented with #2825.
Instead of

  uriPattern:    'posts/{post}'
  defaults:
    '@package':    Blog
    '@controller': Post
    '@action':     show
  routeParts:
    post:
      handler: F3\Blog\RoutePartHandlers\PostRoutePartHandler

I could imagine something like
  uriPattern:    'posts/{post}'
  defaults:
    '@package':    Blog
    '@controller': Post
    '@action':     show
  routeParts:
    post:
      handler: IdentityRoutePartHandler
      options:
        model: F3\Blog\Domain\Model\Post
        pattern: '{date}/{title}'

Then you wouldn't need a custom RoutePart handler anymore most cases..

Note1: the namespace of the handler can be omitted when it is in the FLOW3 package
Note2: the line "handler: IdentityRoutePartHandler" could be implicit for domain models
Note3: how to handle the date format here? should we somehow support regular expressions in the pattern?


Related issues

Related to TYPO3.Flow - Feature #29972: Configurable RedirectsUnder ReviewTim Kandel2011-09-18

Actions
Has duplicate TYPO3.Flow - Feature #26688: Magic Object RoutesClosedBastian Waidelich2011-05-06

Actions

Also available in: Atom PDF