beego学习笔记(4):开发文档阅读(5)

controller的逻辑:

我们看下面的代码,就知道怎么传值的:

import (
        "github.com/astaxie/beego"
)

type MainController struct {
        beego.Controller
}

func (this *MainController) Get() {
        this.Data["Website"] = "beego.me"
        this.Data["Email"] = "astaxie@gmail.com"
        this.TplName = "index.tpl"
}
原文地址:https://www.cnblogs.com/aomi/p/9249835.html