Documentation ¶
Index ¶
- func FormFn(formOptions ...FormHelperOption) any
- func FormForFn(formOptions ...FormHelperOption) any
- func NewForm(opts tags.Options, help hctx.Context) *form
- func NewFormFor(model any, opts tags.Options, hctx hctx.Context) *formFor
- func NewSelectTag(opts tags.Options) *tags.Tag
- type FormHelperOption
- func UseCheckboxClass(class string) FormHelperOption
- func UseDateInputClass(class string) FormHelperOption
- func UseErrorClass(class string) FormHelperOption
- func UseFieldContainerClass(class string) FormHelperOption
- func UseFileClass(class string) FormHelperOption
- func UseInputClass(class string) FormHelperOption
- func UseLabelClass(class string) FormHelperOption
- func UseRadioClass(class string) FormHelperOption
- func UseSelectClass(class string) FormHelperOption
- func UseTextAreaClass(class string) FormHelperOption
- type Selectable
- type SelectableMultiple
- type SelectableMultiples
- type Selectables
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormFn ¶
func FormFn(formOptions ...FormHelperOption) any
FormFn returns a helper function to build forms. The resulting function can be used as replacement for the original form helper.
func FormForFn ¶
func FormForFn(formOptions ...FormHelperOption) any
FormForFn returns a helper function to build forms. The resulting function can be used as replacement for the original form helper.
func NewForm ¶
NewForm creates a new form from passed options, it sets POST as the default method and also handles other methods as PUT by adding a `_method` hidden input.
func NewFormFor ¶
NewFormFor creates a new Formfor with passed options. It takes into account the passed model.
func NewSelectTag ¶
func NewSelectTag(opts tags.Options) *tags.Tag
NewSelectTag constructs a new `<select>` tag.
Types ¶
type FormHelperOption ¶
type FormHelperOption func(*form)
func UseCheckboxClass ¶
func UseCheckboxClass(class string) FormHelperOption
UseCheckboxClass is used to override the default classes for the checkbox element.
func UseDateInputClass ¶
func UseDateInputClass(class string) FormHelperOption
UseDateInputClass is used to override the default classes for the errors.
func UseErrorClass ¶
func UseErrorClass(class string) FormHelperOption
UseErrorClass is used to override the default classes for the errors.
func UseFieldContainerClass ¶
func UseFieldContainerClass(class string) FormHelperOption
UseFieldContainerClass is used to override the default classes for the container element.
func UseFileClass ¶
func UseFileClass(class string) FormHelperOption
UseFileClass is used to override the default classes for the file element.
func UseInputClass ¶
func UseInputClass(class string) FormHelperOption
UseInputClass is used to override the default classes for the input element.
func UseLabelClass ¶
func UseLabelClass(class string) FormHelperOption
UseLabelClass is used to override the default classes for the label element.
func UseRadioClass ¶
func UseRadioClass(class string) FormHelperOption
UseRadioClass is used to override the default classes for the radio element.
func UseSelectClass ¶
func UseSelectClass(class string) FormHelperOption
UseSelectClass is used to override the default classes for the select element.
func UseTextAreaClass ¶
func UseTextAreaClass(class string) FormHelperOption
UseTextAreaClass is used to override the default classes for the textarea element.
type Selectable ¶
type Selectable interface { SelectValue() interface{} SelectLabel() string }
Selectable allows any struct to become an option in the select tag.
type SelectableMultiple ¶
type SelectableMultiple interface {
IsSelected() bool
}
SelectableMultiple allows any struct to add Selected option in the select tag.
type SelectableMultiples ¶
type SelectableMultiples []SelectableMultiple
SelectableMultiples is the plural for SelectableMultiple