From c4250872ca55e63217c16804c1de5900f7e3200d Mon Sep 17 00:00:00 2001 From: "asta.xie" Date: Fri, 7 Feb 2014 17:25:56 +0800 Subject: [PATCH] controller data inherit the context's data --- controller.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/controller.go b/controller.go index 76061a81..38e57b59 100644 --- a/controller.go +++ b/controller.go @@ -76,6 +76,9 @@ func (c *Controller) Init(ctx *context.Context, controllerName, actionName strin c.TplExt = "tpl" c.AppController = app c.EnableReander = true + for k, v := range ctx.Input.Data { + c.Data[k] = v + } } // Prepare runs after Init before request function execution.