Documentation ¶
Overview ¶
Package common This package provides basic constants used by forms packages.
Index ¶
- Constants
- Variables
- func CachedConfig(cachedKey string) (r *config.Config, ok bool)
- func CachedTemplate(cachedKey string) (r *template.Template, ok bool)
- func ClearCachedConfig()
- func ClearCachedTemplate()
- func CreateUrl(widget string) string
- func DelCachedConfig(key string) bool
- func DelCachedTemplate(key string) bool
- func ParseFS(fs fs.FS, files ...string) (*template.Template, error)
- func ParseFiles(files ...string) (*template.Template, error)
- func ParseTmpl(data interface{}, fn_tpl template.FuncMap, ...) string
- func SetCachedConfig(cachedKey string, c *config.Config) bool
- func SetCachedTemplate(cachedKey string, tmpl *template.Template) bool
- func SetTmplDir(style, tmplDir string)
- func Tag(t reflect.Type, f reflect.StructField, tagName string) (value string, tf tagfast.Faster)
- func TagVal(t reflect.Type, fieldNo int, tagName string) string
- func TmplDir(style string) (tmplDir string)
- func TmplExists(tmpl string) bool
- type FileSystems
- type HTMLAttrValues
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 TplFuncs = func() template.FuncMap { return template.FuncMap{} }
Functions ¶
func ClearCachedConfig ¶ added in v1.4.0
func ClearCachedConfig()
func ClearCachedTemplate ¶
func ClearCachedTemplate()
func DelCachedConfig ¶ added in v1.4.0
func DelCachedTemplate ¶ added in v1.4.0
func SetCachedConfig ¶ added in v1.4.0
func SetTmplDir ¶ added in v1.4.0
func SetTmplDir(style, tmplDir string)
func TmplExists ¶ added in v1.4.0
Types ¶
type FileSystems ¶ added in v1.4.4
var ( LabelFn = func(s string) string { return s } FileSystem FileSystems )
func (FileSystems) IsEmpty ¶ added in v1.4.4
func (f FileSystems) IsEmpty() bool
func (FileSystems) Open ¶ added in v1.4.4
func (f FileSystems) Open(name string) (file fs.File, err error)
func (*FileSystems) Register ¶ added in v1.4.4
func (f *FileSystems) Register(fileSystem fs.FS)
func (FileSystems) Size ¶ added in v1.4.4
func (f FileSystems) Size() int
type HTMLAttrValues ¶ added in v1.6.0
type HTMLAttrValues []string
func (*HTMLAttrValues) Add ¶ added in v1.6.0
func (s *HTMLAttrValues) Add(value string)
func (HTMLAttrValues) IsEmpty ¶ added in v1.6.0
func (s HTMLAttrValues) IsEmpty() bool
func (*HTMLAttrValues) Remove ¶ added in v1.6.0
func (s *HTMLAttrValues) Remove(value string)
func (HTMLAttrValues) Size ¶ added in v1.6.0
func (s HTMLAttrValues) Size() int
func (HTMLAttrValues) String ¶ added in v1.6.0
func (s HTMLAttrValues) String() string
Click to show internal directories.
Click to hide internal directories.