[FLOW3-general] Loop in Routing Parts
Johannes Steu
typo at motiv-sport.de
Tue Apr 10 21:31:20 CEST 2012
Hi Bastian,
thanks for you reply. I will look deeply into this later this weekend.
But this should help me out!
Johannes
Am 09.04.2012 um 23:55 schrieb Bastian Waidelich:
> Johannes Steu wrote:
>
> Hi Johannes,
>
>> i'd like to have my route like this:
>> http://... .de/cat1/cat2/cat3/ ... depending on the amount of subcategories.
>> [...] Is it possible to build something like a loop in the routes.yaml
>
> Loops in the route are not possible without custom RoutePartHandlers.
>
>> If it is not possible i tired to set the part on my own. [...]
>> Is it possible to keep the slash?
>
> Yes, the "magic" lies in the method findValueToMatch() which you can override. It receives the complete rest of the request path (e.g. "cat1/cat2/cat3/foo.html") and you can return everything that belongs to your route (in this case "cat1/cat2/cat3").
>
> Then, in the matchValue() method you'll receive that part and can post process it.
> Just make sure that matchValue() and resoveValue() are deterministic and that you are not allowed to return objects.
> Also have a look at the NodeRoutePartHandler of the TYPO3 package [1] - it's responsibility is to turn a request path into a TYPO3CR node vice versa.
>
> Please let us know if that helped,
> Bastian
>
> [1] http://git.typo3.org/FLOW3/Packages/TYPO3.TYPO3.git?a=blob;f=Classes/Routing/FrontendNodeRoutePartHandler.php;h=bbe9081f33dbd84e67a2e920cb3cb474514ae13f;hb=HEAD
>
> _______________________________________________
> FLOW3-general mailing list
> FLOW3-general at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/flow3-general
>
More information about the FLOW3-general
mailing list