func (c *MainController) Get() { c.Data["IsHome"] = true c.TplNames = "home.html" var err error c.Data["blogs"], err = models.GetAllTopics() if err != nil { beego.Error(err) } c.Data["IsLogin"] = checkAccount(c.Ctx) }
func (this *TopicController) Get() { this.Data["IsTopic"] = true this.Data["IsLogin"] = checkAccount(this.Ctx) var err error this.Data["Topics"], err = models.GetAllTopics() if err != nil { beego.Error(err) } this.TplNames = "topic.html" }