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) Cols() int
- func (f *FieldSetType) Data() map[string]interface{}
- func (f *FieldSetType) Disable() *FieldSetType
- func (f *FieldSetType) Elements(elems ...config.FormElement)
- func (f *FieldSetType) Enable() *FieldSetType
- func (f *FieldSetType) Field(name string) fields.FieldInterface
- func (f *FieldSetType) FieldSet(name string) *FieldSetType
- func (f *FieldSetType) Lang() string
- func (f *FieldSetType) LangSet(name string) *LangSetType
- 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) SetHelptext(text string) *FieldSetType
- 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 ...config.FormElement) *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 (form *Form) ParseModelElements(model interface{}, es ElementSetter, elements []*config.Element, ...)
- func (form *Form) ParseModelFromConfig(model interface{}, insertErrors ...bool) *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) Reset() *Form
- 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) SetStructFieldConverter(convert func(string) 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(model ...interface{}) *Form
- func (form *Form) ValidFromJSON(b []byte, key string) error
- func (form *Form) ValidFromJSONFile(jsonFile string) error
- func (f *Form) ValidModel(model interface{}, onlyCheckFields ...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) Cols() int
- 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 ...config.FormElement) *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) SetHelptext(text string) *LangSetType
- 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 ¶
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 ¶
func Html5Validate(valid string, f fields.FieldInterface)
func ValidationEngine ¶
func ValidationEngine(valid string, f fields.FieldInterface)
Types ¶
type ElementSetter ¶
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"`
Helptext string `json:"helpText" xml:"helpText"`
FieldList []config.FormElement `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 ...config.FormElement) *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 ¶
func (f *FieldSetType) Clone() config.FormElement
func (*FieldSetType) Cols ¶
func (f *FieldSetType) Cols() int
func (*FieldSetType) Data ¶
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)
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) FieldSet ¶
func (f *FieldSetType) FieldSet(name string) *FieldSetType
FieldSet returns the fieldset identified by name. It returns an empty field if it is missing.
func (*FieldSetType) Lang ¶
func (f *FieldSetType) Lang() string
func (*FieldSetType) LangSet ¶
func (f *FieldSetType) LangSet(name string) *LangSetType
LangSet returns the fieldset identified by name. It returns an empty field if it is missing.
func (*FieldSetType) Name ¶
func (f *FieldSetType) Name() string
Name returns the name of the fieldset.
func (*FieldSetType) OriginalName ¶
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 ¶
func (f *FieldSetType) SetFieldCols(cols int)
func (*FieldSetType) SetHelptext ¶
func (f *FieldSetType) SetHelptext(text string) *FieldSetType
SetHelptext saves the field helptext.
func (*FieldSetType) SetLabelCols ¶
func (f *FieldSetType) SetLabelCols(cols int)
func (*FieldSetType) SetLang ¶
func (f *FieldSetType) SetLang(lang string)
func (*FieldSetType) SetName ¶
func (f *FieldSetType) SetName(name string)
func (*FieldSetType) SetTemplate ¶
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 ¶
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 ¶
func NewWithConfig ¶
func NewWithConfigFile ¶
func NewWithModelConfig ¶
func (*Form) AddBeforeRender ¶
func (*Form) AddCSS ¶
AddCSS add a CSS value (in the form of option-value - e.g.: border - auto) to the form.
func (*Form) CloseValid ¶
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 ¶
func (f *Form) Error() (err *validation.ValidationError)
func (*Form) Errors ¶
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) Filter ¶
func (form *Form) Filter(values url.Values) (url.Values, *validation.ValidationError)
Filter 过滤客户端提交的数据
func (*Form) FilterByElement ¶
func (form *Form) FilterByElement(input url.Values, output url.Values, ele *config.Element) (url.Values, *validation.ValidationError)
FilterByElement 过滤单个元素
func (*Form) GenChoices ¶
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 ¶
func (*Form) InsertErrors ¶
func (*Form) LangSet ¶
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 ...config.FormElement) *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 ¶
func (f *Form) NewLangSet(name string, langs []*config.Language) *LangSetType
func (*Form) ParseElements ¶
func (*Form) ParseFromConfig ¶
func (*Form) ParseFromJSONFile ¶
func (*Form) ParseModel ¶
func (*Form) ParseModelElements ¶
func (*Form) ParseModelFromConfig ¶
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 ¶
func (*Form) SetStructFieldConverter ¶
func (*Form) SetValidTagFunc ¶
func (f *Form) SetValidTagFunc(fn func(string, fields.FieldInterface)) *Form
func (*Form) ToJSONBlob ¶
func (*Form) ValidElements ¶
func (*Form) ValidFromConfig ¶
func (*Form) ValidFromJSONFile ¶
func (*Form) ValidModel ¶
func (*Form) ValidTagFunc ¶
func (f *Form) ValidTagFunc() func(string, fields.FieldInterface)
func (*Form) Validate ¶
func (f *Form) Validate() *validation.Validation
type Forms ¶
type Forms struct {
*Form
}
func (*Forms) MarshalJSON ¶
MarshalJSON allows type Pagination to be used with json.Marshal
func (*Forms) MarshalXML ¶
MarshalXML allows type Pagination to be used with xml.Marshal
type LangSetType ¶
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"`
Helptext string `json:"helpText" xml:"helpText"`
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 ¶
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 ¶
func (f *LangSetType) AddLanguage(language *config.Language)
func (*LangSetType) AddTag ¶
func (f *LangSetType) AddTag(tag string) *LangSetType
AddTag adds a no-value parameter (e.g.: "disabled", "checked") to the langset.
func (*LangSetType) Clone ¶
func (f *LangSetType) Clone() config.FormElement
func (*LangSetType) Cols ¶
func (f *LangSetType) Cols() int
func (*LangSetType) Data ¶
func (f *LangSetType) Data() map[string]interface{}
func (*LangSetType) DeleteParam ¶
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 ¶
func (f *LangSetType) Disable() *LangSetType
Disable adds tag "disabled" to the langset, making it unresponsive in some environment (e.g.: Bootstrap).
func (*LangSetType) Elements ¶
func (f *LangSetType) Elements(elems ...config.FormElement)
Elements adds the provided elements to the langset.
func (*LangSetType) Enable ¶
func (f *LangSetType) Enable() *LangSetType
Enable removes tag "disabled" from the langset, making it responsive.
func (*LangSetType) Field ¶
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 ¶
func (f *LangSetType) FieldSet(name string) *FieldSetType
FieldSet returns the fieldset identified by name. param format: "language:name"
func (*LangSetType) Lang ¶
func (f *LangSetType) Lang() string
func (*LangSetType) Name ¶
func (f *LangSetType) Name() string
Name returns the name of the langset.
func (*LangSetType) NewFieldSet ¶
func (f *LangSetType) NewFieldSet(name string, label string, elems ...config.FormElement) *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 ¶
func (f *LangSetType) OriginalName() string
func (*LangSetType) RemoveTag ¶
func (f *LangSetType) RemoveTag(tag string) *LangSetType
RemoveTag removes a tag from the langset, if it was present.
func (*LangSetType) Render ¶
func (f *LangSetType) Render() template.HTML
Render translates a FieldSetType into HTML code and returns it as a template.HTML object.
func (*LangSetType) SetData ¶
func (f *LangSetType) SetData(key string, value interface{})
func (*LangSetType) SetHelptext ¶
func (f *LangSetType) SetHelptext(text string) *LangSetType
SetHelptext saves the field helptext.
func (*LangSetType) SetLang ¶
func (f *LangSetType) SetLang(lang string)
func (*LangSetType) SetName ¶
func (f *LangSetType) SetName(name string)
func (*LangSetType) SetParam ¶
func (f *LangSetType) SetParam(k string, v interface{}) *LangSetType
SetParam saves the provided param for the langset.
func (*LangSetType) SetTemplate ¶
func (f *LangSetType) SetTemplate(tmpl string) *LangSetType
func (*LangSetType) Sort ¶
func (f *LangSetType) Sort(sortList ...string) *LangSetType
Sort Sort("field1:1,field2:2") or Sort("field1:1","field2:2")
func (*LangSetType) Sort2Last ¶
func (f *LangSetType) Sort2Last(fieldsName ...string) *LangSetType
func (*LangSetType) SortAll ¶
func (f *LangSetType) SortAll(sortList ...string) *LangSetType
SortAll("field1,field2") or SortAll("field1","field2")
func (*LangSetType) String ¶
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. |
