开发者

Find a relative path in sitemap

I have defined some menus in sitemap:

...
Menu("index",S ? "home") / "index"
...
Now, in runtime, I want to determine the relatative url from name of the menu. So I would like if some function like this existed: LiftRules.siteMap.getUrl("index") and the result would be a String : /contextPath/index. I ignore the fact that sitemap returns a Box. Is there some function like this? Btw I want to use it in S.redirect, it accepts a String, If I hardcode some String there, It can create problems if I later change the path in Menu def开发者_运维知识库inition.


There is a link method in Loc:

val details = Loc("details", "profile" :: "details" :: Nil, "Details", Hidden)
details.link.createPath
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜