On Mon, Nov 15, 2010 at 11:10 AM, Dorian Taylor (Lists) <
[email protected]> wrote:

>
>
> package MyApp;
>
> sub _date :Regex('^(\d{4}-\d{2}-\d{2})(.*)$') {
>    my ($self, $c) = @_;
>    my ($date, $rest) = @{$c->req->captures};
>    $c->req->path($rest);
>    $c->dispatcher->prepare_action($c);
>    $c->go($c->action, $c->req->args);
> }
>
> This exhibits exactly the behaviour I was looking for.
>

Not sure I'd recommend this approach, but at one point I had code that
worked something like this: before prepare_action ran I'd look at the path
and if the first path segment matched a list of values I'd then strip that
segment off the path, set a flag in the stash, and then update $c->req->path
with the new path and continue the request.



-- 
Bill Moseley
[email protected]
_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/

Reply via email to