Update 13.5.md
this.Ctx.Input.Params is map, not fund
This commit is contained in:
@@ -100,7 +100,7 @@ EditController
|
||||
}
|
||||
|
||||
func (this *EditController) Get() {
|
||||
id, _ := strconv.Atoi(this.Ctx.Input.Params(":id"))
|
||||
id, _ := strconv.Atoi(this.Ctx.Input.Params[":id"])
|
||||
this.Data["Post"] = models.GetBlog(id)
|
||||
this.Layout = "layout.tpl"
|
||||
this.TplNames = "new.tpl"
|
||||
@@ -124,9 +124,9 @@ DeleteController
|
||||
}
|
||||
|
||||
func (this *DeleteController) Get() {
|
||||
id, _ := strconv.Atoi(this.Ctx.Input.Params(":id"))
|
||||
id, _ := strconv.Atoi(this.Ctx.Input.Params(":id"))
|
||||
blog := GetBlog(id int)
|
||||
this.Data["Post"] = blog
|
||||
this.Data["Post"] = blog
|
||||
models.DelBlog(blog)
|
||||
this.Ctx.Redirect(302, "/")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user