ptemplate

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2024 License: MIT Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

type Engine struct {
	sync.Once
	*template.Template
	// contains filtered or unexported fields
}

func New

func New(viewDir, ext string, reload bool) *Engine

func NewWithFS

func NewWithFS(fs fs.FS, ext string, funcMap template.FuncMap) *Engine

NewWithFS 基于Fs对象创建模板 由于调用ParseFS创建template对象, funcMap必须在调用时传入, 否则可能会出现无法解析函数

func (*Engine) AddFunc

func (engine *Engine) AddFunc(funcName string, funcEntry interface{})

func (*Engine) Ext

func (engine *Engine) Ext() string

func (*Engine) HTML

func (engine *Engine) HTML(writer io.Writer, name string, binding map[string]interface{}) error

Jump to

Keyboard shortcuts

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