在 url 中添加额外字段,但在 Catalyst 框架的 url 处理中避免该字段
假设我有一个 url
http://www.somesite.com/path/to/catalyst/controller
并且我想将其重定向到
http://www.somesite.com/extra-part/path/to/catalyst/controller
这个额外部分应该只在 url 中,并且不应该被考虑用于 Catalyst 的 URL 处理。
我发现,我们可以为此继承/覆盖prepare_path方法,但我无法正确使用它。
我找到了这个链接: Catalyst Wiki
但仍然需要帮助。
Suppose I have a url
http://www.somesite.com/path/to/catalyst/controller
And I want to redirect this to
http://www.somesite.com/extra-part/path/to/catalyst/controller
This extra-part should only be in url, And should not be considered for URL handling of Catalyst.
I found that, we can inherit/override prepare_path method for this but I couldn't use it properly.
I found this link for that :
Catalyst Wiki
But still help needed.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在
lib/MyApp.pm
内部,我有一个函数prepare_path
,如下所示:在
myapp.conf
中定义:Inside of
lib/MyApp.pm
I have a functionprepare_path
that looks like this:And in
myapp.conf
is defined: