Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting full path URLs in views/templates

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

@{'/public/stylesheets/main.css'} returns 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?

like image 318
bArmageddon Avatar asked Aug 13 '11 21:08

bArmageddon


1 Answers

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).

like image 116
sgibout Avatar answered Oct 21 '22 11:10

sgibout