[FEATURE] Allow to directly declare static route variables
Instead of having to use custom route aspect mappers, implementing `StaticMappableAspectInterface`, to avoid having `&cHash=` signatures being applied to the generated URL, variables now can be simply declared `static` in the corresponding route enhancer configuration. By using the new `static` route configuration directive, custom aspect mapper implementations can be avoided. However, static route variables are only applied for a particular variable name if no other aspect mapper is defined (those would take precedence) and if a companion `requirements` definition is given (should be restrictive, to reduce possible cache flooding scenarios). Example: routeEnhancers: Verification: type: Simple routePath: '/verify/{code}' static: code: true requirements: code: '[a-f0-9]{40}' Resolves: #93100 Releases: main Change-Id: I4a929c88622ec49fca92fc7699ea96bfa7565309 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/74016 Tested-by:Benni Mack <benni@typo3.org> Tested-by:
core-ci <typo3@b13.com> Reviewed-by:
Benni Mack <benni@typo3.org> Reviewed-by:
Georg Ringer <georg.ringer@gmail.com> Tested-by:
Georg Ringer <georg.ringer@gmail.com>
Showing
- typo3/sysext/core/Classes/Routing/Enhancer/AbstractEnhancer.php 26 additions, 0 deletions...sysext/core/Classes/Routing/Enhancer/AbstractEnhancer.php
- typo3/sysext/core/Classes/Routing/Enhancer/PluginEnhancer.php 2 additions, 1 deletion...3/sysext/core/Classes/Routing/Enhancer/PluginEnhancer.php
- typo3/sysext/core/Classes/Routing/Enhancer/SimpleEnhancer.php 2 additions, 1 deletion...3/sysext/core/Classes/Routing/Enhancer/SimpleEnhancer.php
- typo3/sysext/core/Classes/Routing/PageRouter.php 1 addition, 0 deletionstypo3/sysext/core/Classes/Routing/PageRouter.php
- typo3/sysext/core/Classes/Routing/Route.php 4 additions, 7 deletionstypo3/sysext/core/Classes/Routing/Route.php
- typo3/sysext/core/Documentation/Changelog/13.3/Feature-93100-AllowToDirectlyDeclareStaticRouteVariables.rst 55 additions, 0 deletions...ture-93100-AllowToDirectlyDeclareStaticRouteVariables.rst
- typo3/sysext/extbase/Classes/Routing/ExtbasePluginEnhancer.php 1 addition, 0 deletions.../sysext/extbase/Classes/Routing/ExtbasePluginEnhancer.php
- typo3/sysext/frontend/Tests/Functional/SiteHandling/EnhancerLinkGenerator/StaticVariableTest.php 136 additions, 0 deletions...SiteHandling/EnhancerLinkGenerator/StaticVariableTest.php
- typo3/sysext/frontend/Tests/Functional/SiteHandling/EnhancerSiteRequest/StaticVariableTest.php 120 additions, 0 deletions...l/SiteHandling/EnhancerSiteRequest/StaticVariableTest.php
Please register or sign in to comment