github.com/gogf/gf@v1.16.9/.example/os/gview/resource/main2.go (about)

     1  package main
     2  
     3  import (
     4  	"fmt"
     5  
     6  	"github.com/gogf/gf/frame/g"
     7  	"github.com/gogf/gf/os/gres"
     8  	_ "github.com/gogf/gf/os/gres/testdata"
     9  )
    10  
    11  func main() {
    12  	gres.Dump()
    13  
    14  	v := g.View()
    15  	v.SetPath("files/template/layout2")
    16  	s, err := v.Parse("layout.html", g.Map{
    17  		"mainTpl": "main/main1.html",
    18  	})
    19  	fmt.Println(err)
    20  	fmt.Println(s)
    21  }