[Catalyst] How to forward to a specific path

Julien Sobrier julien at sobrier.net
Sat Jan 2 00:31:22 GMT 2010


Right,
but this mapping is stored somewhere since it is displayed by Catalyst in
debug mode:

.-------------------------------------+------------------------------------=
--.
| Path                                | Private                           |
+-------------------------------------+------------------------------------=
--+
| /                                     | /index
|
| /                                     | /default
|
| /admin                            | /admin/admin                   |


2010/1/1 Eisenberger Tam=E1s <tamas at eisenberger.hu>

>  Hy!
>
> I think your problem is that there is a difference between how an url
> dispatched to an action, and how forward finds the action to forward to...
>
> so for example, if you have a controller (YourApp::Controller::Foo) with =
an
> index method you can access it with the url path /foo, but you should use
> /foo/index in forward... so the 'private' path to the action is different
> from the 'public' path in many times!
>
>
> On 01/01/2010 11:26 PM, Julien Sobrier wrote:
>
> Hello,
> I'm try to do a forward to a path rather than a controller. For example, =
if
> I get the url /foo/my/path, I want to redirect it to /my/path which belon=
gs
> to a different controller. In the controllfer Foo, I tried something like
> this:
>
> sub foo :Path :Args {
>     my ($self, $c) =3D @_
>
>    $c->forward("/" . join("/", @{$c->req->args}); #
> $c->forward("/my/path");
> }
>
>
> I cannot fin the righrt command to forward to any path.
>
> Thank you
> Julien
>
>
> _______________________________________________
> 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.u=
k/
> Dev site: http://dev.catalyst.perl.org/
>
>
> _______________________________________________
> 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/
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20100101/c4592=
635/attachment.htm


More information about the Catalyst mailing list