Documentation ¶
Overview ¶
Render package renders HTML templates found in the rootpath/views folder of the project. Go and Jet templating engines can be used. See https://github.com/CloudyKit/jet for full documentation on Jet. Expected filenaming for Go templates <template_name>.page.tmpl, for Jet templates <template_name>.jet.
This package has built in CSRF protection with https://github.com/justinas/nosurf.
Index ¶
- type Renderer
- func (r *Renderer) GoPage(w http.ResponseWriter, req *http.Request, view string, data interface{}) error
- func (r *Renderer) JetPage(w http.ResponseWriter, req *http.Request, view string, variables interface{}, ...) error
- func (r *Renderer) Page(w http.ResponseWriter, req *http.Request, view string, variables interface{}, ...) error
- type TemplateData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Renderer ¶
type Renderer struct {
// contains filtered or unexported fields
}
func (*Renderer) GoPage ¶
func (r *Renderer) GoPage(w http.ResponseWriter, req *http.Request, view string, data interface{}) error
GoPage renders a template using the GO templating engine.
Click to show internal directories.
Click to hide internal directories.