gin_pongo2

package module
v0.0.0-...-a62c6c2 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2015 License: Apache-2.0 Imports: 10 Imported by: 0

README

echo-pongo2

Usage


import p "github.com/easykoo/echo-pongo2"

	t := pongo2.PrepareTemplates(pongo2.Options{
		Directory:  "public/views/",
		Extensions: []string{".html"},
	})
	e.SetRenderer(t)

	mData := make(map[string]interface{})
	return c.Render(http.StatusOK, "share", mData)

##License

This code is under an Apache v2 License.

Author

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context echo.Context

func C

func C(c *echo.Context) *Context

type Options

type Options struct {
	// Directory to load templates. Default is "templates"
	Directory string
	// Extensions to parse template files from. Defaults to [".tmpl", ".html"]
	Extensions []string
}

type Template

type Template struct {
	// contains filtered or unexported fields
}

func PrepareTemplates

func PrepareTemplates(option Options) *Template

func (*Template) Render

func (t *Template) Render(w io.Writer, templateName string, data interface{}) error

Jump to

Keyboard shortcuts

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