Documentation ¶
Index ¶
- func AddFuncMap(key string, fn interface{}) error
- func AddTemplateExt(ext string)
- func AssetsCSS(src string) template.HTML
- func AssetsJs(src string) template.HTML
- func BuildTemplate(dir string, files ...string) error
- func Compare(a, b interface{}) (equal bool)
- func CompareNot(a, b interface{}) (equal bool)
- func Date(t time.Time, format string) string
- func DateFormat(t time.Time, layout string) (datestring string)
- func DateParse(dateString, format string) (time.Time, error)
- func ExecuteTemplate(wr io.Writer, name string, data interface{}) error
- func HTML2str(html string) string
- func HasTemplateExt(paths string) bool
- func Htmlquote(src string) string
- func Htmlunquote(src string) string
- func MapGet(arg1 interface{}, arg2 ...interface{}) (interface{}, error)
- func NotNil(a interface{}) (isNil bool)
- func ParseForm(form url.Values, obj interface{}) error
- func RenderForm(obj interface{}) template.HTML
- func Str2html(raw string) template.HTML
- func Substr(s string, start, length int) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddFuncMap ¶
AddFuncMap let user to register a func in the template.
func AddTemplateExt ¶
func AddTemplateExt(ext string)
AddTemplateExt add new extension for template.
func BuildTemplate ¶
BuildTemplate will build all template files in a directory. it makes beego can render any template file in view directory.
func Compare ¶
func Compare(a, b interface{}) (equal bool)
Compare is a quick and dirty comparison function. It will convert whatever you give it to strings and see if the two values are equal. Whitespace is trimmed. Used by the template parser as "eq".
func DateFormat ¶
DateFormat takes a time and a layout string and returns a string with the formatted date. Used by the template parser as "dateformat"
func ExecuteTemplate ¶
ExecuteTemplate applies the template with name to the specified data object, writing the output to wr. A template will be executed safely in parallel.
func HasTemplateExt ¶
HasTemplateExt return this path contains supported template extension of beego or not.
func MapGet ¶
func MapGet(arg1 interface{}, arg2 ...interface{}) (interface{}, error)
MapGet getting value from map by keys usage:
Data["m"] = map[string]interface{} { "a": 1, "1": map[string]float64{ "c": 4, }, }
{{ map_get m "a" }} // return 1 {{ map_get m 1 "c" }} // return 4
func RenderForm ¶
RenderForm will render object to form html. obj must be a struct pointer.
Types ¶
This section is empty.