修改代码小错误
This commit is contained in:
@@ -67,7 +67,7 @@ ViewController:
|
||||
}
|
||||
|
||||
func (this *ViewController) 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 = "view.tpl"
|
||||
@@ -104,7 +104,7 @@ EditController
|
||||
id, _ := strconv.Atoi(this.Ctx.Input.Params[":id"])
|
||||
this.Data["Post"] = models.GetBlog(id)
|
||||
this.Layout = "layout.tpl"
|
||||
this.TplNames = "new.tpl"
|
||||
this.TplNames = "edit.tpl"
|
||||
}
|
||||
|
||||
func (this *EditController) Post() {
|
||||
@@ -125,8 +125,8 @@ DeleteController
|
||||
}
|
||||
|
||||
func (this *DeleteController) Get() {
|
||||
id, _ := strconv.Atoi(this.Ctx.Input.Params(":id"))
|
||||
blog := GetBlog(id int)
|
||||
id, _ := strconv.Atoi(this.Ctx.Input.Params[":id"])
|
||||
blog := models.GetBlog(id int)
|
||||
this.Data["Post"] = blog
|
||||
models.DelBlog(blog)
|
||||
this.Ctx.Redirect(302, "/")
|
||||
|
||||
Reference in New Issue
Block a user