[Catalyst] Forward on to other actions after removing first path segment?

Alexander Hartmaier alexander.hartmaier at t-systems.at
Tue Nov 23 17:57:08 GMT 2010


Have you thought about making the date a parameter instead of part of
the uri?

--
Best regards, Alex


On Mon, 2010-11-15 at 20:10 +0100, Dorian Taylor (Lists) wrote:
> Hi Larry,
>
> On 15-Nov-10, at 10:55 AM, Larry Leszczynski wrote:
>
> > Hi Dorian -
> >
> >> OK, but the part that confuses me is why /foo doesn't resolve to
> >> MyApp::Foo::index with ->go or ->visit.
> >
> > Maybe this will help (I think in this case "index" works like
> > "default"):
> >
> >   http://wiki.catalystframework.org/wiki/wikicookbook/safedispatchusingpath
>
>
> According to your wiki page, my solution is thus:
>
> 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.
>
> Thanks,
>
> --
> Dorian Taylor
> Make things. Make sense.
> http://doriantaylor.com
>
>
> _______________________________________________
> List: Catalyst at 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/


*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH   Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*



More information about the Catalyst mailing list