common

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: May 23, 2021 License: MIT Imports: 12 Imported by: 9

Documentation

Overview

Package common This package provides basic constants used by forms packages.

Index

Constants

View Source
const (
	BASE      = "base"
	BOOTSTRAP = "bootstrap3"
)

Available form styles

View Source
const (
	BUTTON         = "button"
	CHECKBOX       = "checkbox"
	COLOR          = "color"
	DATE           = "date"
	DATETIME       = "datetime"
	DATETIME_LOCAL = "datetime-local"
	EMAIL          = "email"
	FILE           = "file"
	HIDDEN         = "hidden"
	IMAGE          = "image"
	MONTH          = "month"
	NUMBER         = "number"
	PASSWORD       = "password"
	RADIO          = "radio"
	RANGE          = "range"
	RESET          = "reset"
	SEARCH         = "search"
	SUBMIT         = "submit"
	TEL            = "tel"
	TEXT           = "text"
	TIME           = "time"
	URL            = "url"
	WEEK           = "week"
	TEXTAREA       = "textarea"
	SELECT         = "select"
	STATIC         = "static"
)

Input field types

View Source
const (
	PACKAGE_NAME = "github.com/coscms/forms"
)

Variables

View Source
var (
	LabelFn = func(s string) string {
		return s
	}
	FileSystem fs.FS
)

Functions

func CachedConfig added in v1.4.0

func CachedConfig(cachedKey string) (r *config.Config, ok bool)

func CachedTemplate

func CachedTemplate(cachedKey string) (r *template.Template, ok bool)

func ClearCachedConfig added in v1.4.0

func ClearCachedConfig()

func ClearCachedTemplate

func ClearCachedTemplate()

func CreateUrl

func CreateUrl(widget string) string

CreateUrl creates the complete url of the desired widget template

func DelCachedConfig added in v1.4.0

func DelCachedConfig(key string) bool

func DelCachedTemplate added in v1.4.0

func DelCachedTemplate(key string) bool

func ParseFS added in v1.4.0

func ParseFS(fs fs.FS, files ...string) (*template.Template, error)

func ParseFiles added in v1.4.0

func ParseFiles(files ...string) (*template.Template, error)

func ParseTmpl added in v1.2.1

func ParseTmpl(data interface{},
	fn_tpl template.FuncMap,
	fn_fixTpl func(tpls ...string) ([]string, error),
	tpls ...string) string

func SetCachedConfig added in v1.4.0

func SetCachedConfig(cachedKey string, c *config.Config) bool

func SetCachedTemplate

func SetCachedTemplate(cachedKey string, tmpl *template.Template) bool

func SetTmplDir added in v1.4.0

func SetTmplDir(style, tmplDir string)

func Tag

func Tag(t reflect.Type, f reflect.StructField, tagName string) (value string, tf tagfast.Faster)

func TagVal added in v1.4.0

func TagVal(t reflect.Type, fieldNo int, tagName string) string

func TmplDir

func TmplDir(style string) (tmplDir string)

func TmplExists added in v1.4.0

func TmplExists(tmpl string) bool

func TplFuncs added in v1.4.0

func TplFuncs() template.FuncMap

Types

This section is empty.

Jump to

Keyboard shortcuts

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