Documentation ¶
Overview ¶
Package gview implements a template engine based on text/template.
模板引擎.
Index ¶
- func ParseContent(content string, params Params) ([]byte, error)
- type FuncMap
- type Params
- type View
- func (view *View) AddPath(path string) error
- func (view *View) Assign(key string, value interface{})
- func (view *View) Assigns(data Params)
- func (view *View) BindFunc(name string, function interface{})
- func (view *View) Parse(file string, params Params, funcmap ...map[string]interface{}) ([]byte, error)
- func (view *View) ParseContent(content string, params Params, funcmap ...map[string]interface{}) ([]byte, error)
- func (view *View) SetDelimiters(left, right string)
- func (view *View) SetPath(path string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type View ¶
type View struct {
// contains filtered or unexported fields
}
视图对象
func (*View) Parse ¶
func (view *View) Parse(file string, params Params, funcmap ...map[string]interface{}) ([]byte, error)
解析模板,返回解析后的内容
Directories ¶
Path | Synopsis |
---|---|
internal
|
|
text
from golang-1.11.2 1.
|
from golang-1.11.2 1. |
text/template
Package template implements data-driven templates for generating textual output.
|
Package template implements data-driven templates for generating textual output. |
text/template/parse
Package parse builds parse trees for templates as defined by text/template and html/template.
|
Package parse builds parse trees for templates as defined by text/template and html/template. |
Click to show internal directories.
Click to hide internal directories.