예제 #1
0
func (this *DeleteController) Get() {
	id, _ := strconv.Atoi(this.Ctx.Input.Params[":id"])
	blog := models.GetBlog(id)
	this.Data["Post"] = blog
	models.DelBlog(blog)
	this.Ctx.Redirect(302, "/")
}
예제 #2
0
파일: view.go 프로젝트: nivance/go-example
func (this *ViewController) Get() {
	id, _ := strconv.Atoi(this.Ctx.Input.Params[":id"])
	this.Data["Post"] = models.GetBlog(id)
	this.Layout = "layout.tpl"
	this.TplNames = "view.tpl"
}