package main
import (
"context"
"fmt"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/gview"
)
func main() {
view := gview.New()
view.SetConfigWithMap(g.Map{
"Paths": []string{"template"},
"DefaultFile": "index.html",
"Delimiters": []string{"${", "}"},
"Data": g.Map{
"name": "gf",
"version": "1.10.0",
},
})
result, err := view.ParseContent(context.TODO(), "hello ${.name}, version: ${.version}")
if err != nil {
panic(err)
}
fmt.Println(result)
}