示例#1
0
// NewScope create new instance of scope
func NewScope(tagname string) app.Scope {
	ds := &DataScope{
		Data: make(map[string]interface{}),
	}
	return &Scope{
		EventScope: NewEventScope(),
		DataScope:  app.DataScope(ds),
		Injector:   ds.Injector(tagname),
	}
}
示例#2
0
文件: data.go 项目: goatcms/goat-core
// NewDataScope create new instance of data scope
func NewDataScope(data map[string]interface{}) app.DataScope {
	return app.DataScope(&DataScope{
		Data: make(map[string]interface{}),
	})
}