[Catalyst] redirection hint?
Joe Landman
landman at scalableinformatics.com
Wed Jan 4 20:40:48 CET 2006
Ok, solved.
The redirection is not to the url, but to the private name. So if you
have a
sub something : LocalRegex ('^waahoo/(a|b|c)') {
#...
$c->detach('***');
}
sub elsewhere : LocalRegex ('^waahoo/doit') {
#...
}
and you want the end of this sub to hop over and execute "elsewhere",
then the *** needs to be "elsewhere" and not "waahoo/doit". You are
redirecting to the internal private names, not the public URIs. Thats
fine, just needed to know that.
Joe Landman wrote:
> They both fail ($c->detach('/admin/user/list') and
> $c->forward('/admin/user/list')) with an
>
> [Wed Jan 4 17:03:21 2006] [catalyst] [debug] Couldn't forward to
> command "/admin/user/list". Invalid action or component
>
> I have a
>
> sub main : LocalRegex('^user/(add|delete|update|list|search)') {
> # ...
> }
>
> in the admin controller body, so I thought that the path to this will be
> /admin/user/list
>
>
>
>
>
> Joe Landman wrote:
>> Does $c->detach make more sense for this? That is, I want to have the
>> process go to (but not return from) another method.
>>
>> Kevin Old wrote:
>>> Hi Joe,
>>>
>>> On 1/4/06, Joe Landman <landman at scalableinformatics.com> wrote:
>>>> How do I redirect or forward the tail end of the processing over to
>>>> /admin/list and have it display /admin/list ? Thanks.
>>>
>>> Use $c->forward() to do this.
>>>
>>> sub doit : Local {
>>> #....
>>> $c->forward('/admin/list');
>>> }
>>>
>>> More info is here:
>>> http://search.cpan.org/~sri/Catalyst-5.61/lib/Catalyst.pm#Processing_and_response_to_the_current_request
>>>
>>>
>>> Hope this helps,
>>> Kevin
>>> --
>>> Kevin Old
>>> kevinold at gmail.com
>>
>
--
Joseph Landman, Ph.D
Founder and CEO
Scalable Informatics LLC,
email: landman at scalableinformatics.com
web : http://www.scalableinformatics.com
phone: +1 734 786 8423
fax : +1 734 786 8452 or +1 866 888 3112
cell : +1 734 612 4615
More information about the Catalyst
mailing list