1
0
mirror of https://github.com/astaxie/beego.git synced 2025-07-12 00:11:02 +00:00

add supoort AppController

http://play.golang.org/p/MZptHZeYUx
This commit is contained in:
astaxie
2013-09-28 23:30:36 +08:00
parent e79d756d06
commit a62ed10ab3
2 changed files with 14 additions and 11 deletions

View File

@ -22,16 +22,17 @@ import (
)
type Controller struct {
Ctx *context.Context
Data map[interface{}]interface{}
ChildName string
TplNames string
Layout string
TplExt string
_xsrf_token string
gotofunc string
CruSession session.SessionStore
XSRFExpire int
Ctx *context.Context
Data map[interface{}]interface{}
ChildName string
TplNames string
Layout string
TplExt string
_xsrf_token string
gotofunc string
CruSession session.SessionStore
XSRFExpire int
AppController interface{}
}
type ControllerInterface interface {
@ -48,13 +49,14 @@ type ControllerInterface interface {
Render() error
}
func (c *Controller) Init(ctx *context.Context, childName string) {
func (c *Controller) Init(ctx *context.Context, childName string, app interface{}) {
c.Data = make(map[interface{}]interface{})
c.Layout = ""
c.TplNames = ""
c.ChildName = childName
c.Ctx = ctx
c.TplExt = "tpl"
c.AppController = app
}
func (c *Controller) Prepare() {