提交 0bdd400f 编写于 作者: O odiel

Update utils.go

Adding Assets functions for the template, to generate HTML tags for JS and CSS
上级 8cf34fce
......@@ -388,3 +388,22 @@ func GetRandomString(n int) string {
func UrlFor(endpoint string, values ...string) string {
return BeeApp.UrlFor(endpoint, values...)
}
//This can be changed to a better name
func AssetsJs(src string) template.HTML {
text := string(src)
text = "<script src=\""+src+"\"></script>"
return template.HTML(text)
}
//This can be changed to a better name
func AssetsCss(src string) template.HTML {
text := string(src)
text = "<link href=\""+src+"\" rel=\"stylesheet\" />"
return template.HTML(text)
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册