Formex v0.6.7 Formex.Form

Summary

Functions

Defines the Formex.Form struct

Finds form item by name

Finds form item by struct name

Returns list of items which user can control (all except the Button)

Returns list of items which can be validated (alias for get_fields_controllable/1)

Returns list of names of items with changed name (item.name != item.struct_name)

Finds form item by struct_name and returns name

Finds form item by name and returns struct_name

Is controllable (all except the Button)

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

Types

t()
t() :: %Formex.Form{errors: term, items: term, mapped_params: term, method: term, new_struct: term, opts: term, params: term, phoenix_form: term, struct: term, struct_info: term, struct_module: term, submitted?: term, template: term, template_options: term, type: term, valid?: term}

Functions

__struct__()

Defines the Formex.Form struct.

find(form, name)
find(form :: t, name :: atom) :: list

Finds form item by name

find_by_struct_name(form, name)
find_by_struct_name(form :: t, name :: atom) :: list

Finds form item by struct name

get_collections(form)
get_collections(form :: t) :: list

Returns list of Formex.FormCollection.t/0

get_fields(form)
get_fields(form :: t) :: list

Returns list of Formex.Field.t/0

get_fields_controllable(form)
get_fields_controllable(form :: t) :: list

Returns list of items which user can control (all except the Button)

get_fields_validatable(form)
get_fields_validatable(form :: t) :: list

Returns list of items which can be validated (alias for get_fields_controllable/1)

get_items_with_changed_name(form)
get_items_with_changed_name(form :: t) :: list

Returns list of names of items with changed name (item.name != item.struct_name)

get_name_by_struct_name(form, struct_name)
get_name_by_struct_name(form :: t, struct_name :: atom) :: atom

Finds form item by struct_name and returns name

get_nested(form)
get_nested(form :: t) :: list

Returns list of Formex.FormNested.t/0

get_struct_name_by_name(form, name)
get_struct_name_by_name(form :: t, name :: atom) :: atom

Finds form item by name and returns struct_name

get_subforms(form)
get_subforms(form :: t) :: list

Returns list of Formex.FormNested.t/0 and Formex.FormCollection.t/0

is_controllable(item)
is_controllable(item :: any) :: boolean

Is controllable (all except the Button)

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

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