如何将公共路径转发到另一个 Catalyst 控制器?
假设公共 URL /faq 链接到我的 Catalyst 应用程序中的私有路径 /faq/index:
package MyApp::Controller:FAQ;
sub index :Path {
[....]
我如何从另一个控制器转发到 /faq,也就是说我如何知道 URL /faq 的操作是/常见问题解答/索引?像这样的东西:
$c->forward(c->dispatcher->get_action_by_path( "/faq" )); # does not work
Let say the public URL /faq is linked to the private path /faq/index in my Catalyst application:
package MyApp::Controller:FAQ;
sub index :Path {
[....]
How can I do a forward to /faq from another controller, that is how can I know that the action for the URL /faq is /faq/index ? Something like:
$c->forward(c->dispatcher->get_action_by_path( "/faq" )); # does not work
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我从 Catalyst 邮件列表中得到了答案:
I got the answer for the Catalyst mailing list: