Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Path-Router CPAN distribution.

Report information
The Basics
Id: 78812
Status: new
Priority: 0/
Queue: Path-Router

People
Owner: Nobody in particular
Requestors: hanenkamp [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)



Subject: Slurpy matching via *:foo and +:bar
I have a custom extension of Path::Router::Route for one of my applications that adds a couple features. The one relavant to this "bug report" is the ability to create slurpy path matches. This extension allows for the last component in the path spec to be a variable starting with "+" or "*" which work similar to the "?" modifier. The difference being that they will consume all remaining path parts as well and place everything (whether zero parts or one part or 100 parts) into an array reference. This allows for routes defined like this: $self->add_route('page/:action/:repository/*:page' => ... ); $self->add_route('attachment/:action/:repository/+:file' => ... ); which allows me to give the files in the wiki a natural tree structure within the git repository, making any git repository a potential wiki database. You can see the code in the extension here: https://metacpan.org/source/HANENKAMP/Yukki-0.121790/lib/Yukki/Web/Router/Route.pm and in use here: https://metacpan.org/source/HANENKAMP/Yukki-0.121790/lib/Yukki/Web/Router.pm If you are interested, I can fold that into Path::Router and send you a patch. Cheers.