Documentation ¶
Index ¶
- Constants
- func GetTemplate(name string) string
- func GetTemplateContents(templatepath string) string
- func GetTemplatePath(templatename string) string
- func TemplateRender(name string, c *Context)
- func Upper(s string) string
- func UrlParamsToMap(params httprouter.Params) map[string]interface{}
- type Context
- type Field
- type Form
- type View
Constants ¶
View Source
const TemplateDirectories = "/templates"
Variables ¶
This section is empty.
Functions ¶
func GetTemplate ¶
func GetTemplateContents ¶
func GetTemplatePath ¶
func TemplateRender ¶
func UrlParamsToMap ¶
func UrlParamsToMap(params httprouter.Params) map[string]interface{}
Types ¶
type Context ¶
type Context struct { Data map[string]interface{} Form url.Values Writer http.ResponseWriter }
type Form ¶
type View ¶
type View struct { TemplateName string Form Form Get func(c *Context) Post func(c *Context, e []string) GetContext func(map[string]interface{}) map[string]interface{} }
func (View) HandleGet ¶
func (view View) HandleGet(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
func (View) HandlePost ¶
func (view View) HandlePost(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
flow: check Post func then handleget if no post
Click to show internal directories.
Click to hide internal directories.