Documentation
¶
Index ¶
- func RegisterFunc(funcName string, funcBody interface{})
- type TemplateProxy
- func (p *TemplateProxy) CloneTemplate() *template.Template
- func (p *TemplateProxy) Execute(wr io.Writer, data interface{}, clone bool) error
- func (p *TemplateProxy) ExecuteTemplate(wr io.Writer, data interface{}, clone bool) error
- func (p *TemplateProxy) ExecuteTemplateByName(wr io.Writer, name string, data interface{}, clone bool) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterFunc ¶
func RegisterFunc(funcName string, funcBody interface{})
funcBody: 函数必须只有1个值或2个值,如果有两个值,第二个值必须是error类型的,当执行函数时err不为空,则执行自动停止。
Types ¶
type TemplateProxy ¶
func LoadTemplate ¶
func LoadTemplate(tempFile string) (*TemplateProxy, error)
func LoadTemplates ¶
func LoadTemplates(tempFiles string) (*TemplateProxy, error)
func NewTemplate ¶
func NewTemplate(name string, text string) (*TemplateProxy, error)
func (*TemplateProxy) CloneTemplate ¶
func (p *TemplateProxy) CloneTemplate() *template.Template
func (*TemplateProxy) Execute ¶
func (p *TemplateProxy) Execute(wr io.Writer, data interface{}, clone bool) error
func (*TemplateProxy) ExecuteTemplate ¶
func (p *TemplateProxy) ExecuteTemplate(wr io.Writer, data interface{}, clone bool) error
func (*TemplateProxy) ExecuteTemplateByName ¶
Click to show internal directories.
Click to hide internal directories.