gpt4 book ai didi

html - Golang 在 Revel 中将字符串渲染为 html

转载 作者:数据小太阳 更新时间:2023-10-29 03:17:30 37 4
gpt4 key购买 nike

我需要在 Revel 中将字符串呈现为 html。这该怎么做?我试过:

func (c Pages) Show(url string) revel.Result {    
bigDig := "<h1>Hello, dig!</h1>"

return c.Render(bigDig)
}

然后在 View 中:

{{template "header.html" .}}

{{.bigDig}}

{{template "footer.html" .}}

但它不起作用。如何做到这一点?

最佳答案

关于html - Golang 在 Revel 中将字符串渲染为 html,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24692092/

37 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com