Exemplo n.º 1
0
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"
}
Exemplo n.º 2
0
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"
}
Exemplo n.º 3
0
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")
	}
}