Documentation ¶
Index ¶
- func NewSelectTag(opts tags.Options) *tags.Tag
- type Form
- func (f Form) CheckboxTag(opts tags.Options) *tags.Tag
- func (f Form) DateTimeTag(opts tags.Options) *tags.Tag
- func (f Form) FileTag(opts tags.Options) *tags.Tag
- func (f Form) HiddenTag(opts tags.Options) *tags.Tag
- func (f Form) InputTag(opts tags.Options) *tags.Tag
- func (f Form) Label(value string, opts tags.Options) *tags.Tag
- func (f Form) RadioButton(opts tags.Options) *tags.Tag
- func (f Form) RadioButtonTag(opts tags.Options) *tags.Tag
- func (f Form) SelectTag(opts tags.Options) *tags.Tag
- func (f *Form) SetAuthenticityToken(s string)
- func (f Form) SubmitTag(value string, opts tags.Options) *tags.Tag
- func (f Form) TextArea(opts tags.Options) *tags.Tag
- func (f Form) TextAreaTag(opts tags.Options) *tags.Tag
- type FormFor
- func (f FormFor) CheckboxTag(field string, opts tags.Options) *tags.Tag
- func (f FormFor) DateTimeTag(field string, opts tags.Options) *tags.Tag
- func (f FormFor) FileTag(field string, opts tags.Options) *tags.Tag
- func (f FormFor) HiddenTag(field string, opts tags.Options) *tags.Tag
- func (f FormFor) InputTag(field string, opts tags.Options) *tags.Tag
- func (f FormFor) RadioButton(field string, opts tags.Options) *tags.Tag
- func (f FormFor) RadioButtonTag(field string, opts tags.Options) *tags.Tag
- func (f FormFor) SelectTag(field string, opts tags.Options) *tags.Tag
- func (f FormFor) SubmitTag(value string, opts tags.Options) *tags.Tag
- func (f FormFor) TextArea(field string, opts tags.Options) *tags.Tag
- func (f FormFor) TextAreaTag(field string, opts tags.Options) *tags.Tag
- type SelectOption
- type SelectOptions
- type SelectTag
- type Selectable
- type SelectableMultiple
- type SelectableMultiples
- type Selectables
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Form ¶
Form is the html form tag, this will hold other tags inside it.
func New ¶
New creates a new form from passed options, it sets defaults for method and also handles other methods as PUT by adding _method hidden input.
func (Form) CheckboxTag ¶
CheckboxTag builds a checkbox from the options passed
func (Form) DateTimeTag ¶
DateTimeTag generates a tag with type datetime-local and adds default format to be 2006-01-02T03:04
func (Form) FileTag ¶
FileTag builds an input[type=file] from the options passed, it also sets the form enctype to be "multipart/form-data"
func (Form) InputTag ¶
InputTag generates an input tag with passed options, by default will be type=text.
func (Form) RadioButton ¶
RadioButton creates a radio button for a form with the passed options
func (Form) RadioButtonTag ¶
RadioButtonTag creates a radio button for a form with the passed options
func (*Form) SetAuthenticityToken ¶
SetAuthenticityToken allows tags to work smoothly with Buffalo, it receives the auth token and creates an input hidden with it.
type FormFor ¶
type FormFor struct { *Form Model interface{} Errors *validate.Errors // contains filtered or unexported fields }
FormFor is a form made for a struct
func NewFormFor ¶
NewFormFor creates a new Formfor with passed options, it also creates the id of the form from the struct name and adds errors if present.
func (FormFor) CheckboxTag ¶
CheckboxTag creates a checkbox for a field on the form Struct
func (FormFor) DateTimeTag ¶
DateTimeTag creates a input[type=datetime-local] for a field name passed
func (FormFor) RadioButton ¶
RadioButton creates a radio button for a struct field
func (FormFor) RadioButtonTag ¶
RadioButtonTag creates a radio button for a struct field
func (FormFor) SelectTag ¶
SelectTag creates a select tag for a specified struct field and loads options from the options opject
type SelectOption ¶
SelectOption describes a HTML <select> tag <option> meta data.
func (SelectOption) String ¶
func (s SelectOption) String() string
type SelectTag ¶
type SelectTag struct { *tags.Tag SelectedValue interface{} SelectOptions SelectOptions // contains filtered or unexported fields }
SelectTag describes a HTML <select> tag meta data.
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