开发者

Getting full path URLs in views/templates

<link rel="stylesheet" href="@{'/public/stylesheets/main.css'}">

@{'/public/stylesheets/main.css'} 开发者_如何学Creturns the relative path: /public/stylesheets/main.css

How do I get the full path? i.e. http://www.something.com/public/stylesheets/main.css inside the view/template?


You have to use

@@{'/public/stylesheets/mains.CSS}

instead of using single @. See this PlayFramework Template Cheatsheet for example.


From PlayFramework Templates Documentation explains it as:

The @@{…} syntax does the same but generates an absolute URL (notably useful for e-mail).

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜