mirror of
https://gitee.com/johng/gf.git
synced 2024-12-01 11:48:09 +08:00
22 lines
320 B
Go
22 lines
320 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/gogf/gf/frame/g"
|
|
"github.com/gogf/gf/os/gfile"
|
|
)
|
|
|
|
func main() {
|
|
v := g.View()
|
|
v.AddPath(gfile.MainPkgPath() + gfile.Separator + "template")
|
|
b, err := v.Parse("index.html", map[string]interface{}{
|
|
"k": "v",
|
|
})
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
fmt.Println(string(b))
|
|
|
|
}
|