コード例 #1
0
func Edit(w http.ResponseWriter, r *http.Request) {
	vars := mux.Vars(r)
	id := vars["id"]
	post_title := vars["title"]
	p := categories.GetSingleCategory(id, post_title)
	categories.RenderTemplate(w, "edit-category", p)
}
コード例 #2
0
func Index(w http.ResponseWriter, r *http.Request) {
	p := categories.GetCategories()
	categories.RenderTemplate(w, "categories", p)
}
コード例 #3
0
func New(w http.ResponseWriter, r *http.Request) {
	collection := new(categories.Data)
	p := collection
	categories.RenderTemplate(w, "new-category", p)
}