Exemplo n.º 1
0
func (this *EditController) Get() {
	objectId := this.GetString(":ObjectId")
	id := bson.ObjectIdHex(objectId)

	this.Data["Post"] = models.GetBlog(id)
	this.Layout = "layout.tpl"
	this.TplName = "edit.tpl"
}
Exemplo n.º 2
0
func (this *DeleteController) Get() {

	objectId := this.GetString(":ObjectId")
	id := bson.ObjectIdHex(objectId)

	blog := models.GetBlog(id)
	this.Data["Post"] = blog
	models.DelBlog(blog)
	this.Ctx.Redirect(302, "/")
}