@{'/public/stylesheets/main.cs...">

Getting full path urls in views / templates

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

@{'/public/stylesheets/main.css'} returns relative path: /public/stylesheets/main.css

How do I get the full path? those. http://www.something.com/public/stylesheets/main.cssinside view / template?

+5
source share
1 answer

You have to use

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

instead of using single @. See this template playlist template .


Of documentation templates PlayFramework explains it as:

The @@ {...} syntax does the same, but generates an absolute URL (particularly useful for email).

+8
source

All Articles