Documentation ¶
Overview ¶
Package forms This package provides form creation and rendering functionalities, as well as FieldSet definition. Two kind of forms can be created: base forms and Bootstrap3 compatible forms; even though the latters are automatically provided the required classes to make them render correctly in a Bootstrap environment, every form can be given custom parameters such as classes, id, generic parameters (in key-value form) and stylesheet options.
Copyright 2016-present Wenhui Shen <www.webx.top>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2016-present Wenhui Shen <www.webx.top> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Copyright 2016-present Wenhui Shen <www.webx.top> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Constants
- func GenChoices(lenType interface{}, fnType interface{}) interface{}
- func Html5Validate(valid string, f fields.FieldInterface)
- func NewConfig() *config.Config
- func Unmarshal(b []byte, key string) (r *config.Config, err error)
- func UnmarshalFile(filename string) (r *config.Config, err error)
- func ValidationEngine(valid string, f fields.FieldInterface)
- type ElementSetter
- type FieldSetType
- func (f *FieldSetType) AddClass(class string) *FieldSetType
- func (f *FieldSetType) AddTag(tag string) *FieldSetType
- func (f *FieldSetType) Clone() config.FormElement
- func (f *FieldSetType) Data() map[string]interface{}
- func (f *FieldSetType) Disable() *FieldSetType
- func (f *FieldSetType) Elements(elems ...config.FormElement) *FieldSetType
- func (f *FieldSetType) Enable() *FieldSetType
- func (f *FieldSetType) Field(name string) fields.FieldInterface
- func (f *FieldSetType) Lang() string
- func (f *FieldSetType) Name() string
- func (f *FieldSetType) OriginalName() string
- func (f *FieldSetType) RemoveClass(class string) *FieldSetType
- func (f *FieldSetType) RemoveTag(tag string) *FieldSetType
- func (f *FieldSetType) Render() template.HTML
- func (f *FieldSetType) SetData(key string, value interface{})
- func (f *FieldSetType) SetFieldCols(cols int)
- func (f *FieldSetType) SetLabelCols(cols int)
- func (f *FieldSetType) SetLang(lang string)
- func (f *FieldSetType) SetName(name string)
- func (f *FieldSetType) SetTemplate(tmpl string) *FieldSetType
- func (f *FieldSetType) Sort(sortList ...string) *FieldSetType
- func (f *FieldSetType) Sort2Last(fieldsName ...string) *FieldSetType
- func (f *FieldSetType) SortAll(sortList ...string) *FieldSetType
- func (f *FieldSetType) String() string
- type Form
- func (f *Form) AddBeforeRender(fn func()) *Form
- func (f *Form) AddButton(tmpl string, args ...string) *Form
- func (f *Form) AddCSS(key, value string) *Form
- func (f *Form) AddClass(class string) *Form
- func (form *Form) CloseValid(fieldName ...string) *Form
- func (f *Form) Config() *config.Config
- func (f *Form) Data() map[string]interface{}
- func (f *Form) Debug(args ...bool) *Form
- func (f *Form) DeleteParam(key string) *Form
- func (f *Form) Elements(elems ...config.FormElement)
- func (f *Form) Error() (err *validation.ValidationError)
- func (f *Form) Errors() (errs []*validation.ValidationError)
- func (f *Form) Field(name string) fields.FieldInterface
- func (f *Form) FieldSet(name string) *FieldSetType
- func (f *Form) Fields() []config.FormElement
- func (form *Form) Filter(values url.Values) (url.Values, *validation.ValidationError)
- func (form *Form) FilterByElement(input url.Values, output url.Values, ele *config.Element) (url.Values, *validation.ValidationError)
- func (f *Form) GenChoices(lenType interface{}, fnType interface{}) interface{}
- func (f *Form) GenChoicesForField(name string, lenType interface{}, fnType interface{}) *Form
- func (form *Form) Generate(m interface{}, jsonFile string) error
- func (f *Form) HTMLTemplate() (*template.Template, error)
- func (f *Form) HasError() bool
- func (f *Form) HasErrors() bool
- func (f *Form) Init(c *config.Config, model ...interface{}) *Form
- func (f *Form) InsertErrors() *Form
- func (f *Form) IsDebug() bool
- func (form *Form) IsIgnored(fieldName string) bool
- func (f *Form) IsOmit(fieldName string) (omitFieldValue bool)
- func (f *Form) LabelFunc() func(string) string
- func (f *Form) LangSet(name string) *LangSetType
- func (f *Form) Must(fields ...string) *Form
- func (form *Form) NewConfig() *config.Config
- func (f *Form) NewFieldSet(name string, label string, elems ...fields.FieldInterface) *FieldSetType
- func (f *Form) NewLangSet(name string, langs []*config.Language) *LangSetType
- func (f *Form) Omit(fields ...string) *Form
- func (f *Form) OmitAll(on ...bool) *Form
- func (form *Form) ParseElements(es ElementSetter, elements []*config.Element, langs []*config.Language, ...)
- func (form *Form) ParseFromConfig(insertErrors ...bool) *Form
- func (form *Form) ParseFromJSON(b []byte, key string) error
- func (form *Form) ParseFromJSONFile(jsonFile string) error
- func (f *Form) ParseModel(model ...interface{}) *Form
- func (f *Form) RemoveCSS(key string) *Form
- func (f *Form) RemoveClass(class string) *Form
- func (f *Form) RemoveElement(name string) *Form
- func (f *Form) Render() template.HTML
- func (f *Form) ResetOmitOrMust() *Form
- func (f *Form) SetData(key string, value interface{})
- func (f *Form) SetID(id string) *Form
- func (f *Form) SetLabelFunc(fn func(string) string) *Form
- func (f *Form) SetModel(m interface{}) *Form
- func (f *Form) SetParam(key, value string) *Form
- func (f *Form) SetValidTagFunc(fn func(string, fields.FieldInterface)) *Form
- func (f *Form) Sort(sortList ...string) *Form
- func (f *Form) Sort2Last(fieldsName ...string) *Form
- func (f *Form) SortAll(sortList ...string) *Form
- func (f *Form) String() string
- func (form *Form) ToConfig() *config.Config
- func (f *Form) ToHTML(value interface{}) template.HTML
- func (form *Form) ToJSONBlob(args ...*config.Config) (r []byte, err error)
- func (f *Form) Valid(onlyCheckFields ...string) error
- func (form *Form) ValidElements(elements []*config.Element, t reflect.Type, v reflect.Value)
- func (form *Form) ValidFromConfig() *Form
- func (form *Form) ValidFromJSON(b []byte, key string) error
- func (form *Form) ValidFromJSONFile(jsonFile string) error
- func (f *Form) ValidTagFunc() func(string, fields.FieldInterface)
- func (f *Form) Validate() *validation.Validation
- type Forms
- type LangSetType
- func (f *LangSetType) AddLanguage(language *config.Language)
- func (f *LangSetType) AddTag(tag string) *LangSetType
- func (f *LangSetType) Clone() config.FormElement
- func (f *LangSetType) Data() map[string]interface{}
- func (f *LangSetType) DeleteParam(k string) *LangSetType
- func (f *LangSetType) Disable() *LangSetType
- func (f *LangSetType) Elements(elems ...config.FormElement)
- func (f *LangSetType) Enable() *LangSetType
- func (f *LangSetType) Field(name string) fields.FieldInterface
- func (f *LangSetType) FieldSet(name string) *FieldSetType
- func (f *LangSetType) Lang() string
- func (f *LangSetType) Language(lang string) *config.Language
- func (f *LangSetType) Name() string
- func (f *LangSetType) NewFieldSet(name string, label string, elems ...fields.FieldInterface) *FieldSetType
- func (f *LangSetType) OriginalName() string
- func (f *LangSetType) RemoveTag(tag string) *LangSetType
- func (f *LangSetType) Render() template.HTML
- func (f *LangSetType) SetData(key string, value interface{})
- func (f *LangSetType) SetLang(lang string)
- func (f *LangSetType) SetName(name string)
- func (f *LangSetType) SetParam(k string, v interface{}) *LangSetType
- func (f *LangSetType) SetTemplate(tmpl string) *LangSetType
- func (f *LangSetType) Sort(sortList ...string) *LangSetType
- func (f *LangSetType) Sort2Last(fieldsName ...string) *LangSetType
- func (f *LangSetType) SortAll(sortList ...string) *LangSetType
- func (f *LangSetType) String() string
Constants ¶
const ( POST = "POST" GET = "GET" )
Form methods: POST or GET.
Variables ¶
This section is empty.
Functions ¶
func GenChoices ¶ added in v1.4.0
func GenChoices(lenType interface{}, fnType interface{}) interface{}
GenChoices generate choices
type Data struct{ ID string Name string }
data:=[]*Data{ &Data{ID:"a",Name:"One"}, &Data{ID:"b",Name:"Two"}, }
GenChoices(len(data), func(index int) (string, string, bool){ return data[index].ID,data[index].Name,false })
or
GenChoices(map[string]int{ "":len(data), }, func(group string,index int) (string, string, bool){
return data[index].ID,data[index].Name,false })
func Html5Validate ¶ added in v1.2.1
func Html5Validate(valid string, f fields.FieldInterface)
func UnmarshalFile ¶ added in v1.4.2
func ValidationEngine ¶ added in v1.2.1
func ValidationEngine(valid string, f fields.FieldInterface)
Types ¶
type ElementSetter ¶ added in v1.4.0
type ElementSetter interface {
Elements(...config.FormElement)
}
type FieldSetType ¶
type FieldSetType struct { OrigName string `json:"origName" xml:"origName"` CurrName string `json:"currName" xml:"currName"` Label string `json:"label" xml:"label"` LabelCols int `json:"labelCols" xml:"labelCols"` FieldCols int `json:"fieldCols" xml:"fieldCols"` Classes common.HTMLAttrValues `json:"classes" xml:"classes"` Tags common.HTMLAttrValues `json:"tags" xml:"tags"` FieldList []fields.FieldInterface `json:"fieldList" xml:"fieldList"` AppendData map[string]interface{} `json:"appendData,omitempty" xml:"appendData,omitempty"` FormTheme string `json:"formTheme" xml:"formTheme"` Language string `json:"language,omitempty" xml:"language,omitempty"` Template string `json:"template" xml:"template"` // contains filtered or unexported fields }
FieldSetType is a collection of fields grouped within a form.
func FieldSet ¶
func FieldSet(name string, label string, theme string, elems ...fields.FieldInterface) *FieldSetType
FieldSet creates and returns a new FieldSetType with the given name and list of fields. Every method for FieldSetType objects returns the object itself, so that call can be chained.
func (*FieldSetType) AddClass ¶
func (f *FieldSetType) AddClass(class string) *FieldSetType
AddClass saves the provided class for the fieldset.
func (*FieldSetType) AddTag ¶
func (f *FieldSetType) AddTag(tag string) *FieldSetType
AddTag adds a no-value parameter (e.g.: "disabled", "checked") to the fieldset.
func (*FieldSetType) Clone ¶ added in v1.4.0
func (f *FieldSetType) Clone() config.FormElement
func (*FieldSetType) Data ¶ added in v1.3.1
func (f *FieldSetType) Data() map[string]interface{}
func (*FieldSetType) Disable ¶
func (f *FieldSetType) Disable() *FieldSetType
Disable adds tag "disabled" to the fieldset, making it unresponsive in some environment (e.g.: Bootstrap).
func (*FieldSetType) Elements ¶
func (f *FieldSetType) Elements(elems ...config.FormElement) *FieldSetType
Elements adds the provided elements to the fieldset.
func (*FieldSetType) Enable ¶
func (f *FieldSetType) Enable() *FieldSetType
Enable removes tag "disabled" from the fieldset, making it responsive.
func (*FieldSetType) Field ¶
func (f *FieldSetType) Field(name string) fields.FieldInterface
Field returns the field identified by name. It returns an empty field if it is missing.
func (*FieldSetType) Lang ¶ added in v1.4.0
func (f *FieldSetType) Lang() string
func (*FieldSetType) Name ¶
func (f *FieldSetType) Name() string
Name returns the name of the fieldset.
func (*FieldSetType) OriginalName ¶ added in v1.4.0
func (f *FieldSetType) OriginalName() string
func (*FieldSetType) RemoveClass ¶
func (f *FieldSetType) RemoveClass(class string) *FieldSetType
RemoveClass removes the provided class from the fieldset, if it was present. Nothing is done if it was not originally present.
func (*FieldSetType) RemoveTag ¶
func (f *FieldSetType) RemoveTag(tag string) *FieldSetType
RemoveTag removes a tag from the fieldset, if it was present.
func (*FieldSetType) Render ¶
func (f *FieldSetType) Render() template.HTML
Render translates a FieldSetType into HTML code and returns it as a template.HTML object.
func (*FieldSetType) SetData ¶
func (f *FieldSetType) SetData(key string, value interface{})
func (*FieldSetType) SetFieldCols ¶ added in v1.7.0
func (f *FieldSetType) SetFieldCols(cols int)
func (*FieldSetType) SetLabelCols ¶ added in v1.7.0
func (f *FieldSetType) SetLabelCols(cols int)
func (*FieldSetType) SetLang ¶ added in v1.4.0
func (f *FieldSetType) SetLang(lang string)
func (*FieldSetType) SetName ¶ added in v1.4.0
func (f *FieldSetType) SetName(name string)
func (*FieldSetType) SetTemplate ¶ added in v1.8.0
func (f *FieldSetType) SetTemplate(tmpl string) *FieldSetType
func (*FieldSetType) Sort ¶
func (f *FieldSetType) Sort(sortList ...string) *FieldSetType
Sort("field1:1,field2:2") or Sort("field1:1","field2:2")
func (*FieldSetType) Sort2Last ¶ added in v1.3.1
func (f *FieldSetType) Sort2Last(fieldsName ...string) *FieldSetType
func (*FieldSetType) SortAll ¶
func (f *FieldSetType) SortAll(sortList ...string) *FieldSetType
SortAll("field1,field2") or SortAll("field1","field2")
func (*FieldSetType) String ¶
func (f *FieldSetType) String() string
type Form ¶
type Form struct { AppendData map[string]interface{} `json:"appendData,omitempty" xml:"appendData,omitempty"` Model interface{} `json:"model" xml:"model"` FieldList []config.FormElement `json:"fieldList" xml:"fieldList"` Theme string `json:"theme" xml:"theme"` Class common.HTMLAttrValues `json:"class" xml:"class"` ID string `json:"id" xml:"id"` Params map[string]string `json:"params" xml:"params"` CSS map[string]string `json:"css" xml:"css"` Method string `json:"method" xml:"method"` Action template.HTML `json:"action" xml:"action"` // contains filtered or unexported fields }
Form structure.
func NewFromModel ¶ added in v1.4.0
func NewWithConfig ¶ added in v1.4.0
func NewWithConfigFile ¶ added in v1.4.0
func NewWithModelConfig ¶ added in v1.4.0
func (*Form) AddBeforeRender ¶ added in v1.4.0
func (*Form) AddCSS ¶ added in v1.4.0
AddCSS add a CSS value (in the form of option-value - e.g.: border - auto) to the form.
func (*Form) CloseValid ¶ added in v1.4.0
func (*Form) DeleteParam ¶
DeleteParam removes the parameter identified by key from form parameters list.
func (*Form) Elements ¶
func (f *Form) Elements(elems ...config.FormElement)
Elements adds the provided elements to the form.
func (*Form) Error ¶ added in v1.4.0
func (f *Form) Error() (err *validation.ValidationError)
func (*Form) Errors ¶ added in v1.4.0
func (f *Form) Errors() (errs []*validation.ValidationError)
func (*Form) Field ¶
func (f *Form) Field(name string) fields.FieldInterface
Field returns the field identified by name. It returns an empty field if it is missing.
func (*Form) FieldSet ¶
func (f *Form) FieldSet(name string) *FieldSetType
FieldSet returns the fieldset identified by name. It returns an empty field if it is missing.
func (*Form) Fields ¶ added in v1.3.1
func (f *Form) Fields() []config.FormElement
Fields returns all field
func (*Form) Filter ¶ added in v1.4.0
func (form *Form) Filter(values url.Values) (url.Values, *validation.ValidationError)
Filter 过滤客户端提交的数据
func (*Form) FilterByElement ¶ added in v1.4.0
func (form *Form) FilterByElement(input url.Values, output url.Values, ele *config.Element) (url.Values, *validation.ValidationError)
FilterByElement 过滤单个元素
func (*Form) GenChoices ¶ added in v1.4.0
func (f *Form) GenChoices(lenType interface{}, fnType interface{}) interface{}
GenChoices generate choices
type Data struct{ ID string Name string } data:=[]*Data{ &Data{ID:"a",Name:"One"}, &Data{ID:"b",Name:"Two"}, } GenChoices(len(data), func(index int) (string, string, bool){ return data[index].ID,data[index].Name,false })
or
GenChoices(map[string]int{ "":len(data), }, func(group string,index int) (string, string, bool){ return data[index].ID,data[index].Name,false })
func (*Form) GenChoicesForField ¶ added in v1.4.0
func (*Form) HTMLTemplate ¶ added in v1.8.9
func (*Form) InsertErrors ¶ added in v1.4.0
func (*Form) LangSet ¶ added in v1.4.0
func (f *Form) LangSet(name string) *LangSetType
LangSet returns the fieldset identified by name. It returns an empty field if it is missing.
func (*Form) NewFieldSet ¶
func (f *Form) NewFieldSet(name string, label string, elems ...fields.FieldInterface) *FieldSetType
NewFieldSet creates and returns a new FieldSetType with the given name and list of fields. Every method for FieldSetType objects returns the object itself, so that call can be chained.
func (*Form) NewLangSet ¶ added in v1.4.0
func (f *Form) NewLangSet(name string, langs []*config.Language) *LangSetType
func (*Form) ParseElements ¶ added in v1.4.0
func (*Form) ParseFromConfig ¶ added in v1.4.0
func (*Form) ParseFromJSON ¶ added in v1.4.2
func (*Form) ParseFromJSONFile ¶ added in v1.4.2
func (*Form) ParseModel ¶ added in v1.4.0
func (*Form) RemoveClass ¶
RemoveClass removes the given class (if present) from the Form.
func (*Form) RemoveElement ¶
RemoveElement removes an element (identified by name) from the Form.
func (*Form) Render ¶
Render executes the internal template and renders the form, returning the result as a template.HTML object embeddable in any other template.
func (*Form) ResetOmitOrMust ¶ added in v1.4.0
func (*Form) SetLabelFunc ¶ added in v1.4.0
func (*Form) SetValidTagFunc ¶ added in v1.4.0
func (f *Form) SetValidTagFunc(fn func(string, fields.FieldInterface)) *Form
func (*Form) ToJSONBlob ¶ added in v1.4.0
func (*Form) ValidElements ¶ added in v1.4.0
func (*Form) ValidFromConfig ¶ added in v1.4.0
func (*Form) ValidFromJSON ¶ added in v1.4.2
func (*Form) ValidFromJSONFile ¶ added in v1.4.2
func (*Form) ValidTagFunc ¶ added in v1.4.0
func (f *Form) ValidTagFunc() func(string, fields.FieldInterface)
func (*Form) Validate ¶ added in v1.4.0
func (f *Form) Validate() *validation.Validation
type Forms ¶ added in v1.4.0
type Forms struct {
*Form
}
func (*Forms) MarshalJSON ¶ added in v1.4.0
MarshalJSON allows type Pagination to be used with json.Marshal
func (*Forms) MarshalXML ¶ added in v1.4.0
MarshalXML allows type Pagination to be used with xml.Marshal
type LangSetType ¶ added in v1.4.0
type LangSetType struct { Languages []*config.Language `json:"languages" xml:"languages"` CurrName string `json:"currName" xml:"currName"` OrigName string `json:"origName" xml:"origName"` Template string `json:"template" xml:"template"` Params map[string]interface{} `json:"params" xml:"params"` Tags common.HTMLAttrValues `json:"tags" xml:"tags"` AppendData map[string]interface{} `json:"appendData,omitempty" xml:"appendData,omitempty"` Alone bool `json:"alone,omitempty" xml:"alone,omitempty"` FormTheme string `json:"formTheme" xml:"formTheme"` // contains filtered or unexported fields }
LangSetType is a collection of fields grouped within a form.
func LangSet ¶ added in v1.4.0
func LangSet(name string, theme string, languages ...*config.Language) *LangSetType
FieldSet creates and returns a new FieldSetType with the given name and list of fields. Every method for FieldSetType objects returns the object itself, so that call can be chained.
func (*LangSetType) AddLanguage ¶ added in v1.4.0
func (f *LangSetType) AddLanguage(language *config.Language)
func (*LangSetType) AddTag ¶ added in v1.4.0
func (f *LangSetType) AddTag(tag string) *LangSetType
AddTag adds a no-value parameter (e.g.: "disabled", "checked") to the langset.
func (*LangSetType) Clone ¶ added in v1.4.0
func (f *LangSetType) Clone() config.FormElement
func (*LangSetType) Data ¶ added in v1.4.0
func (f *LangSetType) Data() map[string]interface{}
func (*LangSetType) DeleteParam ¶ added in v1.4.0
func (f *LangSetType) DeleteParam(k string) *LangSetType
DeleteParam removes the provided param from the langset, if it was present. Nothing is done if it was not originally present.
func (*LangSetType) Disable ¶ added in v1.4.0
func (f *LangSetType) Disable() *LangSetType
Disable adds tag "disabled" to the langset, making it unresponsive in some environment (e.g.: Bootstrap).
func (*LangSetType) Elements ¶ added in v1.4.0
func (f *LangSetType) Elements(elems ...config.FormElement)
Elements adds the provided elements to the langset.
func (*LangSetType) Enable ¶ added in v1.4.0
func (f *LangSetType) Enable() *LangSetType
Enable removes tag "disabled" from the langset, making it responsive.
func (*LangSetType) Field ¶ added in v1.4.0
func (f *LangSetType) Field(name string) fields.FieldInterface
Field returns the field identified by name. It returns an empty field if it is missing. param format: "language:name"
func (*LangSetType) FieldSet ¶ added in v1.4.0
func (f *LangSetType) FieldSet(name string) *FieldSetType
FieldSet returns the fieldset identified by name. param format: "language:name"
func (*LangSetType) Lang ¶ added in v1.4.0
func (f *LangSetType) Lang() string
func (*LangSetType) Language ¶ added in v1.4.0
func (f *LangSetType) Language(lang string) *config.Language
func (*LangSetType) Name ¶ added in v1.4.0
func (f *LangSetType) Name() string
Name returns the name of the langset.
func (*LangSetType) NewFieldSet ¶ added in v1.4.0
func (f *LangSetType) NewFieldSet(name string, label string, elems ...fields.FieldInterface) *FieldSetType
NewFieldSet creates and returns a new FieldSetType with the given name and list of fields. Every method for FieldSetType objects returns the object itself, so that call can be chained.
func (*LangSetType) OriginalName ¶ added in v1.4.0
func (f *LangSetType) OriginalName() string
func (*LangSetType) RemoveTag ¶ added in v1.4.0
func (f *LangSetType) RemoveTag(tag string) *LangSetType
RemoveTag removes a tag from the langset, if it was present.
func (*LangSetType) Render ¶ added in v1.4.0
func (f *LangSetType) Render() template.HTML
Render translates a FieldSetType into HTML code and returns it as a template.HTML object.
func (*LangSetType) SetData ¶ added in v1.4.0
func (f *LangSetType) SetData(key string, value interface{})
func (*LangSetType) SetLang ¶ added in v1.4.0
func (f *LangSetType) SetLang(lang string)
func (*LangSetType) SetName ¶ added in v1.4.0
func (f *LangSetType) SetName(name string)
func (*LangSetType) SetParam ¶ added in v1.4.0
func (f *LangSetType) SetParam(k string, v interface{}) *LangSetType
SetParam saves the provided param for the langset.
func (*LangSetType) SetTemplate ¶ added in v1.8.0
func (f *LangSetType) SetTemplate(tmpl string) *LangSetType
func (*LangSetType) Sort ¶ added in v1.4.0
func (f *LangSetType) Sort(sortList ...string) *LangSetType
Sort Sort("field1:1,field2:2") or Sort("field1:1","field2:2")
func (*LangSetType) Sort2Last ¶ added in v1.4.0
func (f *LangSetType) Sort2Last(fieldsName ...string) *LangSetType
func (*LangSetType) SortAll ¶ added in v1.4.0
func (f *LangSetType) SortAll(sortList ...string) *LangSetType
SortAll("field1,field2") or SortAll("field1","field2")
func (*LangSetType) String ¶ added in v1.4.0
func (f *LangSetType) String() string
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package common This package provides basic constants used by forms packages.
|
Package common This package provides basic constants used by forms packages. |
Package fields This package provides all the input fields logic and customization methods.
|
Package fields This package provides all the input fields logic and customization methods. |
Package widgets This package contains the base logic for the creation and rendering of field widgets.
|
Package widgets This package contains the base logic for the creation and rendering of field widgets. |