func (this *EditController) Get() { //inputs := this.Input() id, _ := strconv.Atoi(this.Ctx.Input.Params[":id"]) this.Data["Post"] = models.GetBlog(id) this.Layout = "layout.tpl" this.TplNames = "edit.tpl" }
func (this *ViewController) Get() { var id int this.Ctx.Input.Bind(&id, ":id") this.Data["Post"] = models.GetBlog(id) this.Layout = "layout.tpl" this.TplNames = "view.tpl" }
func (this *EditController) Get() { if this.GetSession("root") == models.User && this.GetSession("passwd") == models.Password { var id int this.Ctx.Input.Bind(&id, ":id") this.Data["Post"] = models.GetBlog(id) this.Layout = "layout.tpl" this.TplNames = "edit.tpl" } else { this.Ctx.Redirect(302, "/404") } }