Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Template ¶
A Template wraps go's html/template to provide easier use.
func NewTemplate ¶
NewTemplate creates a new Template object. It will attempt to parse the templates available (*.tmpl files) in the given path and its subdirectories.
func (*Template) LoadTemplates ¶
LoadTemplates loads templates (files ending in .tmpl) from a given directory and all its subdirectories.
func (*Template) ReloadTemplates ¶
ReloadTemplates is a middleware that calls LoadTemplates. It's useful during development to live reload templates in development but shouldn't be used in production.
func (*Template) RenderTemplate ¶
func (t *Template) RenderTemplate(w http.ResponseWriter, name string, data interface{})
RenderTemplate calls ExecuteTemplate on the passed template name. If the template fails to render then render the status code 500 page
Click to show internal directories.
Click to hide internal directories.