代码小纠错

This commit is contained in:
limingjian110@163.com
2015-11-27 17:02:53 +08:00
parent e71da492df
commit e3a38152f2
3 changed files with 14 additions and 10 deletions

View File

@@ -127,7 +127,7 @@ func (this *EditController) Get() {
id, _ := strconv.Atoi(this.Ctx.Params[":id"])
this.Data["Post"] = models.GetBlog(id)
this.Layout = "layout.tpl"
this.TplNames = "new.tpl"
this.TplNames = "edit.tpl"
}
func (this *EditController) Post() {
@@ -151,7 +151,9 @@ type DeleteController struct {
func (this *DeleteController) Get() {
id, _ := strconv.Atoi(this.Ctx.Params[":id"])
this.Data["Post"] = models.DelBlog(id)
blog := models.GetBlog(id)
this.Data["Post"] = blog
models.DelBlog(blog)
this.Ctx.Redirect(302, "/")
}
```