views

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2017 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadViews

func LoadViews(path string)

LoadViews init load view box

Types

type HTML added in v1.0.2

type HTML struct {
	Layout string
	Funcs  template.FuncMap
	Err    map[string]string
	Extra  []string
	Dir    string
	Ext    string
}

type View

type View struct {
	Router *gin.Engine
	Ctx    *gin.Context
	HTML   *HTML
}

func (*View) F added in v1.0.2

func (v *View) F(funcs template.FuncMap) *View

F add view func

func (*View) L added in v1.0.2

func (v *View) L(layout string) *View

L set view layout

func (*View) Render added in v1.0.2

func (v *View) Render(tpl string, args ...gin.H)

Render render a view

func (*View) RenderErr added in v1.0.2

func (v *View) RenderErr(code int, msg string)

RenderErr render a error view

func (*View) T added in v1.0.2

func (v *View) T(tpls ...string) *View

T add view tpl, eg: "layouts/pagination"

Jump to

Keyboard shortcuts

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