ginpon

package module
v0.0.0-...-5347a48 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2015 License: MIT Imports: 4 Imported by: 0

README

gin-pongo2

GoDoc Build Status

pongo2 middleware for Gin

##Example:

package main

import (
    "http"

    "github.com/gin-gonic/gin"
    "github.com/daine46/gin-pongo2"
)

func main() {
    r := gin.Default()

    // first parameter is template's base directory
    r.HTMLRender = ginpon.New("app/views", gin.IsDebugging())

    r.GET("/", func(c *gin.Context) {
	    c.HTML(http.StatusOK, "index.tpl", ginpon.Context{"key": "value"})
    })

    r.Run(":3000")
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context pongo2.Context

type Pongo2

type Pongo2 struct {
	Template *pongo2.Template
	Name     string
	Data     interface{}
}

func (Pongo2) Render

func (p Pongo2) Render(w http.ResponseWriter) error

type Pongo2Common

type Pongo2Common struct {
	BasePath string
}

func New

func New(path string, isDebug bool) *Pongo2Common

func (Pongo2Common) Instance

func (p Pongo2Common) Instance(name string, data interface{}) render.Render

Jump to

Keyboard shortcuts

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