老師您好 能幫我看看問題在哪兒么?
package?main import?( ???"github.com/kataras/iris" ) func?main()?{ ???app?:=?iris.New() ???app.RegisterView(iris.HTML("./views",?".html")) ???app.Get("/",?func(ctx?iris.Context)?{ ??????ctx.ViewData("message",?"Hello?world!") ??????ctx.View("hello.html") ???}) ???app.Run(iris.Addr(":8080")) }
<html> <head> ????<title>Hello?Page</title> </head> <body> <h1>{{.message}}</h1> </body> </html>
2018-12-13
模板文件位置換成絕對路徑就可以了