播放框架:如何使用“moreStyles”和“moreScripts”
问题描述:
在文件 main.html
中,在由播放创建的默认项目中!,就是这一行:
In the file main.html
, in default project created by Play!, there's this line :
#{get 'moreStyles' /}
我明白如果我需要添加更多样式,在我的视图脚本中,我必须使用
I understand that if I need to add more styles, in my view script, I have to use
#{set tag:'value' /}
其中标记
应该是 moreStyles
,但似乎要将值设置为完整的HTML < link>
标记。如果视图需要添加更多样式或脚本会发生什么?
where tag
should be moreStyles
, but it seems worng to set the value to the full HTML <link>
tag. And what happens if the view needs to add more styles, or scripts?
谢谢!
答
您设置了更多样式:
#{set 'moreStyles'}
#{stylesheet 'main.css' /}
#{/set}
喜欢脚本:
#{set 'moreScripts'}
#{script 'base64.js'/}
#{/set}