Exemplo n.º 1
0
func (this *TopicController) Get() {
	this.Data["isTopic"] = true
	this.Data["isLogin"] = checkAccount(this.Ctx)
	this.TplNames = "topic.html"
	fmt.Println("11111")
	topics, err := modules.GetAllTopics(false)
	if err != nil {
		fmt.Println("22222")
		beego.Error(err)
	} else {
		this.Data["Topics"] = topics
		fmt.Println(topics)
	}
}
Exemplo n.º 2
0
func (c *MainController) Get() {
	c.Data["isHome"] = true
	c.Data["isCategoty"] = false
	c.Data["isTopic"] = false
	c.Data["isLogin"] = checkAccount(c.Ctx)
	topics, err := modules.GetAllTopics(true)
	if err != nil {
		beego.Error(err)
	} else {
		c.Data["Topics"] = topics
	}

	c.TplNames = "Home.html"

}