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: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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
⌂ 换网址