开发者

Find a relative path in sitemap

开发者 https://www.devze.com 2023-02-10 21:33 出处:网络
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

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

精彩评论

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