示例#1
0
文件: default.go 项目: gaotangshen/Go
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)
}
示例#2
0
文件: topic.go 项目: gaotangshen/Go
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"
}