view

package
v0.0.0-...-cee7a81 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2017 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Item

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

Item represents a view template.

func New

func New(folder string, extension string) *Item

New returns a new template.

func (*Item) AddVar

func (v *Item) AddVar(key string, value interface{})

AddVar adds a variable to the template variable map.

func (*Item) DelVar

func (v *Item) DelVar(key string)

DelVar removes a variable from the template variable map.

func (*Item) GetVar

func (v *Item) GetVar(key string) interface{}

GetVar returns a value from the template variable map.

func (*Item) Render

func (v *Item) Render(w http.ResponseWriter, r *http.Request) error

Render outputs the template to the ResponseWriter.

func (*Item) SetBaseTemplate

func (v *Item) SetBaseTemplate(s string)

SetBaseTemplate sets the base template to render.

func (*Item) SetExtension

func (v *Item) SetExtension(s string)

SetExtension sets the extensions of the templates.

func (*Item) SetFolder

func (v *Item) SetFolder(s string)

SetFolder sets the folder containing the templates.

func (*Item) SetTemplate

func (v *Item) SetTemplate(s string)

SetTemplate sets the template to render.

func (*Item) SetVars

func (v *Item) SetVars(vars map[string]interface{})

SetVars sets the template variable map.

Jump to

Keyboard shortcuts

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