tplfunc

package
v2.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2019 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	HashSalt          = time.Now().Format(time.RFC3339)
	HashClipPositions = []uint{1, 3, 8, 9}
)
View Source
var NumberFormat = com.NumberFormat
View Source
var TplFuncMap template.FuncMap = template.FuncMap{}/* 105 elements not displayed */

Functions

func Add

func Add(left interface{}, right interface{}) interface{}

func AddSuffix

func AddSuffix(s string, suffix string, args ...string) string

func Append

func Append(renderArgs map[string]interface{}, key string, value interface{}) string

func Base64Decode

func Base64Decode(s string) string

func CaptchaForm

func CaptchaForm(args ...interface{}) template.HTML

CaptchaForm 验证码表单域

func CaptchaFormWithURLPrefix

func CaptchaFormWithURLPrefix(urlPrefix string, args ...interface{}) template.HTML

CaptchaFormWithURLPrefix 验证码表单域

func CaptchaVerify

func CaptchaVerify(captchaSolution string, idGet func(string, ...string) string) bool

CaptchaVerify 验证码验证

func Concat

func Concat(s ...string) string

func Default

func Default(defaultV interface{}, v interface{}) interface{}

func Div

func Div(left interface{}, right interface{}) interface{}

func DurationFormat

func DurationFormat(lang interface{}, t interface{}, args ...string) *com.Durafmt

func Eq

func Eq(left interface{}, right interface{}) bool

func FriendlyTime

func FriendlyTime(t interface{}, args ...interface{}) string

func Hash

func Hash(text, salt string, positions ...uint) string

func Ignore

func Ignore(_ interface{}) interface{}

func InExt

func InExt(fileName string, exts ...string) bool

func InStrSlice

func InStrSlice(values []string, value string) bool

func IsEmpty

func IsEmpty(a interface{}) bool

func IsInf

func IsInf(v interface{}, s interface{}) bool

func IsNaN

func IsNaN(v interface{}) bool

func IsNil

func IsNil(a interface{}) bool

func JSONDecode

func JSONDecode(s string) map[string]interface{}

func JSONEncode

func JSONEncode(s interface{}, indents ...string) string

func Math

func Math(op string, args ...interface{}) interface{}

func Mul

func Mul(left interface{}, right interface{}) interface{}

func New

func New() (r template.FuncMap)

func Nl2br

func Nl2br(text string) string

Nl2br 将换行符替换为<br />

func NlToBr

func NlToBr(text string) template.HTML

NlToBr Replaces newlines with <br />

func NotEmpty

func NotEmpty(a interface{}) bool

func Now

func Now() time.Time

func NumberTrim

func NumberTrim(number interface{}, precision int, separator ...string) string

func SafeBase64Decode

func SafeBase64Decode(s string) string

func SearchStrSlice

func SearchStrSlice(values []string, value string) int

func Set

func Set(renderArgs map[string]interface{}, key string, value interface{}) string

func StrToSlice

func StrToSlice(s string, sep string) []interface{}

func Sub

func Sub(left interface{}, right interface{}) interface{}

func TimestampToTime

func TimestampToTime(timestamp interface{}) time.Time

func ToCSS

func ToCSS(raw string) template.CSS

func ToDecimal

func ToDecimal(number interface{}) decimal.Decimal

func ToDuration

func ToDuration(t interface{}, args ...string) time.Duration

func ToFixed

func ToFixed(value interface{}, precision interface{}) string

func ToFloat64

func ToFloat64(value interface{}) float64

func ToHTML

func ToHTML(raw string) template.HTML

func ToHTMLAttr

func ToHTMLAttr(raw string) template.HTMLAttr

func ToHTMLAttrs

func ToHTMLAttrs(raw map[string]interface{}) (r map[template.HTMLAttr]interface{})

func ToJS

func ToJS(raw string) template.JS

func ToSlice

func ToSlice(s ...interface{}) []interface{}

func ToStrSlice

func ToStrSlice(s ...string) []string

func ToTime

func ToTime(t interface{}) time.Time

func ToURL

func ToURL(raw string) template.URL

func TsToDate

func TsToDate(format string, timestamp interface{}) string

func TsToTime

func TsToTime(timestamp interface{}) time.Time

func URLDecode

func URLDecode(s string) string

func URLValues

func URLValues(values ...interface{}) url.Values

func UnicodeDecode

func UnicodeDecode(str string) string

func Unquote

func Unquote(s string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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