gf/geg/os/gview/assign/assign.go
2019-04-03 00:03:46 +08:00

18 lines
271 B
Go

package main
import (
"fmt"
"github.com/gogf/gf/g"
"github.com/gogf/gf/g/os/gview"
)
func main() {
g.View().Assigns(gview.Params{
"k1": "v1",
"k2": "v2",
})
b, err := g.View().ParseContent(`{{.k1}} - {{.k2}}`, nil)
fmt.Println(err)
fmt.Println(string(b))
}