Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrTemplateDoesntExist = errors.New("Template does not exist.")
Functions ¶
func RenderTemplate ¶
func RenderTemplate(w http.ResponseWriter, r *http.Request, name reload.TmplName, status int, data interface{}) (err error)
RenderTemplate accepts the name of a template and a piece of data (usually a structure) and executes it into the request's handler.
RenderTemplate will write an error page if an error occurs. This breaks from what other functions typically do, but it saves having to constantly type 'if renderTemplate(...) != nil { /* process error */ }' all over the place.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.