formex v0.3.2 Formex.Form

Summary

Functions

Defines the Formex.Form struct

Types

t()
t() :: %Formex.Form{changeset: term, items: term, model: term, params: term, phoenix_form: term, struct: term, template: term, template_options: term, type: term}

Functions

__struct__()

Defines the Formex.Form struct.

  • :type - the module that implements Formex.Type, for example: App.ArticleType
  • :struct - the struct that will be used in Ecto.Changeset.cast, for example: %App.Article{}
  • :model - struct.__struct__, for example: App.Article
  • :items - list of Formex.Field and Formex.Button structs
  • :params - params that will be used in Ecto.Changeset.cast
  • :changeset - %Ecto.Changeset{}
  • :phoenix_form - %Phoenix.HTML.Form{}
  • :template - the module that implements Formex.Template, for example: Formex.Template.BootstrapHorizontal. Can be set via a Formex.View.formex_form_for options
get_fields(form)
get_fields(form :: t) :: list

Returns list of Formex.Field.t/0

put_item(form, item)
put_item(form :: t, item :: any) :: t

Adds field to the form. More: Formex.Field.create_field/4, Formex.Button.create_button/3