Formex v0.6.7 Formex.Button

Summary

Functions

Defines the Formex.Button struct

Types

t()
t() :: %Formex.Button{label: term, name: term, opts: term, phoenix_opts: term, type: term}

Functions

__struct__()

Defines the Formex.Button struct.

  • :name - a field name. By default the same as :type
  • :type - a type of a field that in most cases will be the name of a function from Phoenix.HTML.Form
  • :label - the text label
  • :opts - options
create_button(type, name, opts \\ [])

Creates a new button.

type - may be :submit, :button or :reset.

Example:

form
|> add(:save, :submit, label: "Save it!", phoenix_opts: [
  class: "btn-primary"
])
<%= formex_row f, :save %>