Advertisement
Guest User

Untitled

a guest
Aug 20th, 2014
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. // Shorthand
  2. type M map[string]interface{}
  3.  
  4. func viewHandler(c web.C, w http.ResponseWriter, r *http.Request) {
  5. title := c.URLParams["title"]
  6. p, err := loadPage(title)
  7. if err != nil {
  8. ...
  9. }
  10. // do other things
  11.  
  12. template.ExecuteTemplate(w, "results.html", M{
  13. "title": title,
  14. "results": results,
  15. "pagination": true,
  16. }
  17. }
  18.  
  19. {{range .Results }}
  20. <h1>{{ Result.Name }}</h1>
  21. <p>{{ Result.Body }}</p>
  22. {{ end }}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement