view

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func View

func View(engine *Engine, name string, data interface{}) (string, error)

View 辅助函数,用于快速渲染

Types

type Engine

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

Engine 模板引擎

func New

func New(viewPath string) *Engine

New 创建新的模板引擎

func (*Engine) AddFunc

func (e *Engine) AddFunc(name string, fn interface{})

AddFunc 添加自定义函数

func (*Engine) Load

func (e *Engine) Load() error

Load 加载所有模板

func (*Engine) Render

func (e *Engine) Render(name string, data interface{}) (string, error)

Render 渲染模板

Jump to

Keyboard shortcuts

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