Hi all,

Suppose I want to have the first path match a pattern, like an ISO-8601 date. I then want to chop it out of the URI path and stash it and forward the request on to another handler in the fashion of mod_perl's $r->internal_redirect. Consider:

package MyApp;

sub _date :Regex('^(\d{4}-\d{2}-\d{2})$') {
  my ($self, $c, @args) = @_;
  $c->stash->{date} = $c->req->captures->[0];
  # OK now what goes here?
}

I'm ambiguous on two things:

1) I don't understand why an outside request to /foo will find its way to /foo/index in MyApp::Foo but a forwarded request will not. I understand I'm supposed to use 'visit' or 'go' but they don't seem to do it either. 2) I'm not entirely sure about the 'right' way to get the rest of the request-URI path. As a (.*) in the regex function attribute? Some other way?

Again, my desired effect is to process the rest of the URI path as if it was an outside request, after chopping off the first path segment and stashing it (if it matches a date).

Insights?

Thanks,

--
Dorian Taylor
Make things. Make sense.
http://doriantaylor.com


_______________________________________________
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/

Reply via email to