假设公共URL / faq链接到我的Catalyst应用程序中的专用路径/ faq / index:
package MyApp::Controller:FAQ;
sub index :Path {
[....]
如何从另一个控制器转发/ faq,也就是我怎么知道URL / faq的动作是/ faq / index?类似的东西:
$c->forward(c->dispatcher->get_action_by_path( "/faq" )); # does not work
答案 0 :(得分:2)
我得到了Catalyst邮件列表的答案:
my $path = "/" . join '/', @{$c->req->args};
$c->request->path($path);
$c->dispatcher->prepare_action($c);
$c->detach($c->action, $c->req->args);