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 Formex.FormCollection.t/0
Returns list of Formex.Field.t/0
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
Returns list of Formex.FormNested.t/0
Finds form item by name
and returns struct_name
Returns list of Formex.FormNested.t/0
and Formex.FormCollection.t/0
Is controllable (all except the Button
)
Adds field to the form. More: Formex.Field.create_field/4
, Button.create_button/3
Types
Functions
Defines the Formex.Form struct.
:type
- the module that implementsFormex.Type
, for example:App.ArticleType
:struct
- the struct of your data, for example:%App.Article{}
:new_struct
- the:struct
with:params
applied:struct_module
-struct.__struct__
, for example:App.Article
:struct_info
- additional info about struct, that can differs between implementations ofFormex.BuilderProtocol
:items
- list ofFormex.Field
,Formex.Button
,Formex.FormCollection
andFormex.FormNested
structs:params
- sent parameters, passed byPlug.Conn
:mapped_params
-:params
prepared to create a:new_struct
or to create a changeset byFormex.Ecto
:phoenix_form
-%Phoenix.HTML.Form{}
:template
- the module that implementsFormex.Template
, for example:Formex.Template.BootstrapHorizontal
. Can be set via aFormex.View.formex_form_for
options:template_options
:method
-:post
,:put
etc. May be used byFormex.View
. E.g.Formex.Ecto.Builder
sets here:put
if we editingstruct
,:post
otherwise.:submitted?
- is form submitted? Set byFormex.Controller.handle_form/1
:opts
- additional data passed in a controller. See:Formex.Builder.create_form/5
:valid?
:errors
Finds form item by name
Finds form item by struct name
Returns list of Formex.FormCollection.t/0
Returns list of Formex.Field.t/0
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
)
get_name_by_struct_name(form :: t, struct_name :: atom) :: atom
Finds form item by struct_name
and returns name
Returns list of Formex.FormNested.t/0
Finds form item by name
and returns struct_name
Returns list of Formex.FormNested.t/0
and Formex.FormCollection.t/0
Is controllable (all except the Button
)