Documentation ¶
Overview ¶
Package gmvc provides basic object classes for MVC.
Index ¶
- type Controller
- type Model
- type View
- func (view *View) Assign(key string, value interface{})
- func (view *View) Assigns(data gview.Params)
- func (view *View) BindFunc(name string, function interface{})
- func (view *View) BindFuncMap(funcMap gview.FuncMap)
- func (view *View) Display(file ...string)
- func (view *View) DisplayContent(content string) error
- func (view *View) LockFunc(f func(data gview.Params))
- func (view *View) Parse(file string) (string, error)
- func (view *View) ParseContent(content string) (string, error)
- func (view *View) RLockFunc(f func(data gview.Params))
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller struct { Request *ghttp.Request // 请求数据对象 Response *ghttp.Response // 返回数据对象(r.Response) Server *ghttp.Server // Web Server对象(r.Server) Cookie *ghttp.Cookie // COOKIE操作对象(r.Cookie) Session *ghttp.Session // SESSION操作对象 View *View // 视图对象 }
控制器基类
type View ¶
type View struct {
// contains filtered or unexported fields
}
基于控制器注册的MVC视图基类(一个请求一个视图对象,用完即销毁)
func (*View) BindFunc ¶
BindFunc registers customized template function named <name> with given function <function> to current view object. The <name> is the function name which can be called in template content.
func (*View) BindFuncMap ¶
BindFuncMap registers customized template functions by map to current view object. The key of map is the template function name and the value of map is the address of customized function.
func (*View) ParseContent ¶
直接解析模板内容,并返回解析后的内容
Click to show internal directories.
Click to hide internal directories.