template

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pongo2Renderer

type Pongo2Renderer struct {
	Debug       bool
	TemplateDir string
	// contains filtered or unexported fields
}

Pongo2Renderer is a custom Gin renderer using Pongo2.

func NewPongo2Renderer

func NewPongo2Renderer(templateDir string, debug bool) *Pongo2Renderer

NewPongo2Renderer creates a new Pongo2 renderer.

func (*Pongo2Renderer) HTML

func (r *Pongo2Renderer) HTML(c *gin.Context, code int, name string, data interface{})

HTML renders an HTML template.

func (*Pongo2Renderer) Instance

func (r *Pongo2Renderer) Instance(name string, data interface{}) *pongo2.Template

Instance returns a Pongo2 template instance, using cache if not in debug mode.

func (*Pongo2Renderer) Render

func (r *Pongo2Renderer) Render(c *gin.Context, code int, name string, data interface{}) error

Render renders a Pongo2 template.

Jump to

Keyboard shortcuts

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