render

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Render

type Render struct {
	Renderer    string
	RootPath    string
	Secure      bool
	Port        string
	ServerName  string
	JetViews    *jet.Set
	BlocksViews *blocks.Blocks
	Session     *scs.SessionManager
}

func (*Render) BlocksPage added in v1.0.1

func (r *Render) BlocksPage(writer http.ResponseWriter, request *http.Request, view, layout string, data any) error

BlocksPage The Blocks' engine template renderer function.

func (*Render) DefaultData

func (r *Render) DefaultData(templateData *TemplateData, request *http.Request) *TemplateData

func (*Render) GoPage

func (r *Render) GoPage(writer http.ResponseWriter, request *http.Request, view string, data any) error

GoPage The default go template engine renderer function.

func (*Render) JetPage

func (r *Render) JetPage(writer http.ResponseWriter, request *http.Request, view string, variables interface{}, data any) error

JetPage The jet engine template renderer function.

func (*Render) Page

func (r *Render) Page(writer http.ResponseWriter, request *http.Request, view, layout string, variables interface{}, data any) error

Page The page render function. You can use it to render pages using go or jet templates.

type TemplateData

type TemplateData struct {
	IsAuthenticated bool
	IntMap          map[string]int
	StringMap       map[string]string
	FloatMap        map[string]float64
	Data            any
	CSRFToken       string
	Port            string
	ServerName      string
	Secure          bool
	Error           string
	Flash           string
}

Jump to

Keyboard shortcuts

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