Documentation ¶
Overview ¶
* Copyright (c) 2019. Pandranki Global Private Limited
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultConfig = TemplateConfig{ Root: "views", Extension: ".html", Master: "layouts/master", Partials: []string{}, Funcs: make(template.FuncMap), DisableCache: false, Delims: Delims{Left: "{{", Right: "}}"}, }
Functions ¶
func Middleware ¶
func Middleware(e *TemplateEngine) echo.MiddlewareFunc
func NewMiddleware ¶
func NewMiddleware(config TemplateConfig) echo.MiddlewareFunc
New gin middleware for func `gintemplate.Render()`
Types ¶
type FileHandler ¶
type FileHandler func(config TemplateConfig, tplFile string) (content string, err error)
func DefaultFileHandler ¶
func DefaultFileHandler() FileHandler
type TemplateConfig ¶
type TemplateEngine ¶
type TemplateEngine struct {
// contains filtered or unexported fields
}
func Default ¶
func Default() *TemplateEngine
func New ¶
func New(config TemplateConfig) *TemplateEngine
func (*TemplateEngine) Render ¶
func (e *TemplateEngine) Render(w io.Writer, name string, data interface{}, c echo.Context) error
func (*TemplateEngine) SetFileHandler ¶
func (e *TemplateEngine) SetFileHandler(handle FileHandler)
Click to show internal directories.
Click to hide internal directories.