0 Star 0 Fork 616

李明 / gf

forked from John / gf 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
controller.go 1.10 KB
一键复制 编辑 原始数据 按行查看 历史
John 提交于 2018-04-16 16:50 . ghttp.Request增加Exit
// Copyright 2017 gf Author(https://gitee.com/johng/gf). All Rights Reserved.
//
// This Source Code Form is subject to the terms of the MIT License.
// If a copy of the MIT was not distributed with this file,
// You can obtain one at https://gitee.com/johng/gf.
// MVC
package gmvc
import (
"gitee.com/johng/gf/g/net/ghttp"
)
// 控制器基类
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 // 视图对象
}
// 控制器初始化接口方法
func (c *Controller) Init(r *ghttp.Request) {
c.Request = r
c.Response = r.Response
c.Server = r.Server
c.View = NewView(r.Response)
c.Cookie = r.Cookie
c.Session = r.Session
}
// 控制器结束请求接口方法
func (c *Controller) Shut(r *ghttp.Request) {
}
// 推出请求执行
func (c *Controller) Exit() {
c.Request.Exit()
}
Go
1
https://gitee.com/limingsky/gf.git
git@gitee.com:limingsky/gf.git
limingsky
gf
gf
c9a36a8224f1

搜索帮助

53164aa7 5694891 3bd8fe86 5694891