Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Shorthand
- type M map[string]interface{}
- func viewHandler(c web.C, w http.ResponseWriter, r *http.Request) {
- title := c.URLParams["title"]
- p, err := loadPage(title)
- if err != nil {
- ...
- }
- // do other things
- template.ExecuteTemplate(w, "results.html", M{
- "title": title,
- "results": results,
- "pagination": true,
- }
- }
- {{range .Results }}
- <h1>{{ Result.Name }}</h1>
- <p>{{ Result.Body }}</p>
- {{ end }}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement