func (this *BlogController) Index(ctx web.Context) { ctx.Render(BlogModel{ Posts: []BlogPost{ BlogPost{ Title: "Blog Post #1", Date: time.Now(), Body: template.HTML("An example blog post."), Author: User{ FirstName: "Montana", LastName: "Banana", }, }, BlogPost{ Title: "Blog Post #2", Date: time.Now(), Body: template.HTML("Another example blog post."), Author: User{ FirstName: "Montana", LastName: "Banana", }, }, }, }) }
func (this *BlogController) Show(ctx web.Context, id int) { ctx.Write(fmt.Sprint("ID: ", id)) }