Exemplo n.º 1
0
func IndexController(rw http.ResponseWriter, rq *http.Request) {
	pastes := models.GetAll()
	t, err := template.ParseFiles("src/views/index.tpl")
	if err != nil {
		http.Error(rw, err.Error(), http.StatusInternalServerError)
		return
	}
	t.Execute(rw, pastes)
}
Exemplo n.º 2
0
func (this *IndexController) Get() {
	this.Data["blogs"] = models.GetAll()
	this.Layout = "layout.tpl"
	this.TplNames = "index.tpl"
}