tags: github.com/gobuffalo/tags/form Index | Files | Directories

package form

import "github.com/gobuffalo/tags/form"

Index

Package Files

checkbox_tag.go file_tag.go form.go form_for.go input_tag.go radio_button_tag.go select_options.go select_tag.go selectable.go submit_tag.go text_area_tag.go

func NewSelectTag Uses

func NewSelectTag(opts tags.Options) *tags.Tag

NewSelectTag constructs a new `<select>` tag.

type Form Uses

type Form struct {
    *tags.Tag
}

Form is the html form tag, this will hold other tags inside it.

func New Uses

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 Uses

func (f Form) CheckboxTag(opts tags.Options) *tags.Tag

CheckboxTag builds a checkbox from the options passed

func (Form) DateTimeTag Uses

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 Uses

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 Uses

func (f Form) HiddenTag(opts tags.Options) *tags.Tag

HiddenTag generates and input tag with type hidden

func (Form) InputTag Uses

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) Label Uses

func (f Form) Label(value string, opts tags.Options) *tags.Tag

Label permits to create a label inside a Form

func (Form) RadioButton Uses

func (f Form) RadioButton(opts tags.Options) *tags.Tag

RadioButton creates a radio button for a form with the passed options

func (Form) RadioButtonTag Uses

func (f Form) RadioButtonTag(opts tags.Options) *tags.Tag

RadioButtonTag creates a radio button for a form with the passed options

func (Form) SelectTag Uses

func (f Form) SelectTag(opts tags.Options) *tags.Tag

SelectTag constructs a new `<select>` tag from a form.

func (*Form) SetAuthenticityToken Uses

func (f *Form) SetAuthenticityToken(s string)

SetAuthenticityToken allows tags to work smoothly with Buffalo, it receives the auth token and creates an input hidden with it.

func (Form) SubmitTag Uses

func (f Form) SubmitTag(value string, opts tags.Options) *tags.Tag

SubmitTag generates an input tag with type "submit"

func (Form) TextArea Uses

func (f Form) TextArea(opts tags.Options) *tags.Tag

TextArea creates a textarea for a form with passed options

func (Form) TextAreaTag Uses

func (f Form) TextAreaTag(opts tags.Options) *tags.Tag

TextAreaTag creates a textarea for a form with passed options

type FormFor Uses

type FormFor struct {
    *Form
    Model interface{}

    Errors *validate.Errors
    // contains filtered or unexported fields
}

FormFor is a form made for a struct

func NewFormFor Uses

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 Uses

func (f FormFor) CheckboxTag(field string, opts tags.Options) *tags.Tag

CheckboxTag creates a checkbox for a field on the form Struct

func (FormFor) DateTimeTag Uses

func (f FormFor) DateTimeTag(field string, opts tags.Options) *tags.Tag

DateTimeTag creates a input[type=datetime-local] for a field name passed

func (FormFor) FileTag Uses

func (f FormFor) FileTag(field string, opts tags.Options) *tags.Tag

FileTag creates a input[type=file] for a field name passed

func (FormFor) HiddenTag Uses

func (f FormFor) HiddenTag(field string, opts tags.Options) *tags.Tag

HiddenTag adds a wrappter for input type hidden on the form

func (FormFor) InputTag Uses

func (f FormFor) InputTag(field string, opts tags.Options) *tags.Tag

InputTag creates an input for a field on the form Struct

func (FormFor) RadioButton Uses

func (f FormFor) RadioButton(field string, opts tags.Options) *tags.Tag

RadioButton creates a radio button for a struct field

func (FormFor) RadioButtonTag Uses

func (f FormFor) RadioButtonTag(field string, opts tags.Options) *tags.Tag

RadioButtonTag creates a radio button for a struct field

func (FormFor) SelectTag Uses

func (f FormFor) SelectTag(field string, opts tags.Options) *tags.Tag

SelectTag creates a select tag for a specified struct field and loads options from the options opject

func (FormFor) SubmitTag Uses

func (f FormFor) SubmitTag(value string, opts tags.Options) *tags.Tag

SubmitTag adds a submit button to the form

func (FormFor) TextArea Uses

func (f FormFor) TextArea(field string, opts tags.Options) *tags.Tag

TextArea creates text area for the specified struct field

func (FormFor) TextAreaTag Uses

func (f FormFor) TextAreaTag(field string, opts tags.Options) *tags.Tag

TextAreaTag creates text area for the specified struct field

type SelectOption Uses

type SelectOption struct {
    Value       interface{}
    Label       interface{}
    Selected    bool
    Placeholder bool
}

SelectOption describes a HTML <select> tag <option> meta data.

func (SelectOption) String Uses

func (s SelectOption) String() string

type SelectOptions Uses

type SelectOptions []SelectOption

SelectOptions is a slice of SelectOption

type SelectTag Uses

type SelectTag struct {
    *tags.Tag
    SelectedValue interface{}

    SelectOptions SelectOptions
    // contains filtered or unexported fields
}

SelectTag describes a HTML <select> tag meta data.

func (SelectTag) HTML Uses

func (s SelectTag) HTML() template.HTML

HTML gives the HTML template representation for the select tag.

func (SelectTag) String Uses

func (s SelectTag) String() string

type Selectable Uses

type Selectable interface {
    SelectValue() interface{}
    SelectLabel() string
}

Selectable allows any struct to become an option in the select tag.

type Selectables Uses

type Selectables []Selectable

Selectables is the plural for selectable

Directories

PathSynopsis
bootstrap

Package form imports 13 packages (graph) and is imported by 3 packages. Updated 2019-03-24. Refresh now. Tools for package owners.