Esempio n. 1
0
func (this *TopicController) Get() {
	id := this.Ctx.Input.Param(":id")
	this.Data["IsLogin"] = IsLogin(this)
	beego.Debug(id)
	top, err := models.GetTopicById(id)
	if err != nil {
		beego.Error(err)
	}
	this.Data["Topic"] = top
	this.TplName = "topic_view.html"
}
Esempio n. 2
0
func (this *TopicController) View() {
	id := this.Ctx.Input.Param("0")
	if id == "" {
		this.Redirect("/topic", 302)
		return
	}
	this.Data["IsLogin"] = IsLogin(this)
	beego.Debug(id)
	top, err := models.GetTopicById(id)
	if err != nil {
		beego.Error(err)
	}
	this.Data["Topic"] = top
	this.TplName = "topic_view.html"
}