Example #1
0
func (this *ReplyController) Add() {
	tid := this.Input().Get("tid")

	//beego.Debug(this.Input().Get("nickname"), this.Input().Get("content"))
	beego.Debug()
	err := models.AddReply(tid,
		this.Input().Get("nickname"), this.Input().Get("content"))

	if err != nil {
		beego.Error(err)
	}
	this.Redirect("/topic/view/"+tid, 302)
}
Example #2
0
func (this *ReplyController) Add() {
	tId := this.Input().Get("tid")
	nickName := this.Input().Get("nickname")
	reContent := this.Input().Get("content")

	if tId != "" {
		err := models.AddReply(tId, nickName, reContent)
		if err == nil {
			dir := "/topic/view/" + tId
			this.Redirect(dir, 302)
			return
		}
	}

	this.Redirect("/", 302)
}