假设公共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
我得到了Catalyst邮件列表的答案:
my $path = "/" . join '/', @{$c->req->args}; $c->request->path($path); $c->dispatcher->prepare_action($c); $c->detach($c->action, $c->req->args);