I am using the framework Play 2.0 with Java
I have some html
<div>my html</div>
in a file test.html
Is there anyway I can access the html in another file (say main.html)?
Maybe through some global variable
I tried to surround my html with
@variable{<div>my html</div>}
Then access it from main.html using
@variable
But this didn’t work…
Any ideas?
Templates are basically functions as stated in the link that szegedi mentioned.
I think what you want is called
tagsin Play. Basically you have a file with some HTML: let’s say a progress bar:The file above is called progress.sacala.html and save in views.tags.graphs
The you can
accessor call this piece of HTML by entering the following in one of your views:Of course you can do it without passing any variable, but I thought it would be nice to include the vars as well. Good luck!