views

package
v0.0.0-...-9fb3cb1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 9, 2015 License: MIT Imports: 4 Imported by: 2

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL