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 ¶
func NewSelectTag ¶
func NewSelectTag(opts tags.Options) *tags.Tag
NewSelectTag constructs a new `<select>` tag.
Types ¶
type Form ¶
type Form struct {
*tags.Tag
}
Form is the html form tag, this will hold other tags inside it.
func New ¶
func New(opts tags.Options) *Form
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 ¶
func (f Form) CheckboxTag(opts tags.Options) *tags.Tag
CheckboxTag builds a checkbox from the options passed
func (Form) DateTimeTag ¶
func (f Form) DateTimeTag(opts tags.Options) *tags.Tag
DateTimeTag generates a tag with type datetime-local and adds default format to be 2006-01-02T03:04
func (Form) FileTag ¶
func (f Form) FileTag(opts tags.Options) *tags.Tag
FileTag builds an input[type=file] from the options passed, it also sets the form enctype to be "multipart/form-data"
func (Form) HiddenTag ¶
func (f Form) HiddenTag(opts tags.Options) *tags.Tag
HiddenTag generates and input tag with type hidden
func (Form) InputTag ¶
func (f Form) InputTag(opts tags.Options) *tags.Tag
InputTag generates an input tag with passed options, by default will be type=text.
func (Form) RadioButton ¶
func (f Form) RadioButton(opts tags.Options) *tags.Tag
RadioButton creates a radio button for a form with the passed options
func (Form) RadioButtonTag ¶
func (f Form) RadioButtonTag(opts tags.Options) *tags.Tag
RadioButtonTag creates a radio button for a form with the passed options
func (Form) SelectTag ¶
func (f Form) SelectTag(opts tags.Options) *tags.Tag
SelectTag constructs a new `<select>` tag from a form.
func (*Form) SetAuthenticityToken ¶
SetAuthenticityToken allows tags to work smoothly with Buffalo, it receives the auth token and creates an input hidden with it.
func (Form) TextArea ¶
func (f Form) TextArea(opts tags.Options) *tags.Tag
TextArea creates a textarea for a form with passed options
func (Form) TextAreaTag ¶
func (f Form) TextAreaTag(opts tags.Options) *tags.Tag
TextAreaTag creates a textarea for a form with passed options
type FormFor ¶
type FormFor struct { *Form Model interface{} Errors tags.Errors // contains filtered or unexported fields }
FormFor is a form made for a struct
func NewFormFor ¶
func NewFormFor(model interface{}, opts tags.Options) *FormFor
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
func (FormFor) TextAreaTag ¶
TextAreaTag creates text area for the specified struct field
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