Пример #1
0
func (this *TopicController) Get() {
	this.Data["IsTopic"] = true
	this.Data["IsLogin"] = IsLogin(this)
	this.TplName = "topic.html"
	tps, err := models.GetAllTopic()
	if err != nil {
		beego.Error(err)
	} else {
		this.Data["Topics"] = tps
	}
}
Пример #2
0
func (c *MainController) Get() {
	c.Data["IsLogin"] = c.GetSession("IsLogin")
	c.TplName = "index.html"
	c.Data["IsHome"] = true
	tps, err := models.GetAllTopic()
	if err != nil {
		beego.Error(err)
	} else {
		c.Data["Topics"] = tps
	}
}