Task #2342

Routing: Replace square brackets by curly brackets in dynamic Route Parts

Added by Bastian Waidelich over 6 years ago. Updated almost 5 years ago.

Status:Resolved Start date:2008-12-19
Priority:Should have Due date:
Assigned To:Bastian Waidelich % Done:

100%

Category:MVC
Target version:TYPO3 Flow Base Distribution - 1.0 alpha 1
Sprint: Has patch:
PHP Version: Complexity:

Description

Currently we use square brackets to define a dynamic Route Part:

[@package]/[@controller]/[@action]

To become more similar to the syntax of the upcoming FLOW3 templating engine Fluid, and to be able to use square brackets in URIs (without the need of implementing an escaping syntax) we decided to change the syntax to:
{@package}/{@controller}/{@action}

Additionally, dynamic parts should be enclosed in curly brackets in name patterns too. So instead of:

F3\@package\MVC\Controller\@controllerController

it will be
F3\{@package}\MVC\Controller\{@controller}Controller

Associated revisions

Revision ff26a5c3
Added by Bastian Waidelich over 6 years ago

FLOW3:
  • improved strategy pattern implementation in DynamicRoutePart to simplify creation of custom RoutePartHandlers.
  • parsed URI pattern is not represented as uriPatternSegmentCollection anymore but as simple array of Route Parts making URI matching more flexible and easier to comprehend.
  • added Interfaces RoutePartInterface and DynamicRoutePartInterface
  • improved error handling for invalid URI patterns. Replaced F3\FLOW3\MVC\Exception\SuccessiveDynamicRouteParts by F3\FLOW3\MVC\Exception\InvalidUriPattern.
  • lots of smaller tweaks
  • BREAKING CHANGES:
  • moved all Routes to global Configuration/Routes.yaml. Addresses #2126.
  • dynamic Route Parts are no longer enclosed by square brackets but by curly brackets. Resolves #2342.
  • removed support for query strings in URI pattern for now. It increased complexity and wasn't really needed yet.
  • added support for optional route parts. Just put the respective parts in brackets in your URI pattern. NOTE: Dynamic Route Parts are no longer optional by default (even if a default value is set). Resolves #1790.

History

#1 Updated by Robert Lemke over 6 years ago

  • Target version changed from 0.1 to 1.0 alpha 1

#2 Updated by Bastian Waidelich over 6 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

Applied in changeset r1921.

Also available in: Atom PDF