render

package
v1.0.96 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddDefaultData

func AddDefaultData(td *models.TemplateData, r *http.Request) *models.TemplateData

AddDefaultData contains Data which will be added to data sent to templates

func CreateTemplateCache

func CreateTemplateCache() (map[string]*template.Template, error)

CreateTemplateCache creates a map and stores the tempales in for caching.

func NewTemplates

func NewTemplates(a *config.AppConfig)

NewTemplates sets the config for the template package

func RenderTemplate

func RenderTemplate(w http.ResponseWriter, r *http.Request, tpml string, td *models.TemplateData) error

renderTemplate serves as a wrapper and renders a layout and a template from folder /templates to a desired writer

Types

This section is empty.

Jump to

Keyboard shortcuts

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