From my play20 application i need to generate a HTML file which includes all the external .css/.js/etc.
To generate the HTML file i use
views.html.MyView(Parameter).toString()
But i need to replace the:
<link rel="stylesheet" href="@routes.Assets.at("stylesheets/bootstrap.css")">
with
<script type="text/javascript" charset="utf-8">
@icludeTextFrom(routes.Assets.at("stylesheets/bootstrap.css"))
This function should read the bootstrap.css file and embed it's content here.
</script>
Is there some functionality in Play 2.0 to embed an other file or do i have to copy the content of the files by hand?
Thanks
Fabian
Yes, there’s functionality:
In other words: using
src='@routes...'isn’t obligatory thing, it’s just a helper, you can also replace with static files. You can also add whatever you want to your view, because it’s your view.