func (this *AdminController) Get() { if this.GetSession("root") == models.User && this.GetSession("passwd") == models.Password { this.Data["blogs"] = models.GetAll() this.Layout = "layout.tpl" this.TplNames = "admin.tpl" } else { this.Ctx.Redirect(302, "/404") } }
func (this *IndexController) Get() { this.Data["blogs"] = models.GetAll() this.Layout = "layout.tpl" this.TplNames = "index.tpl" }