Temple v0.1.0 Temple.Form View Source
This modules wraps all of the functions from the Phoenix.HTML.Form
module to make them compatible with with Temple.
Link to this section Summary
Functions
Please see Phoenix.HTML.Form.checkbox/3
for details.
Please see Phoenix.HTML.Form.color_input/3
for details.
Please see Phoenix.HTML.Form.date_input/3
for details.
Please see Phoenix.HTML.Form.date_select/3
for details.
Please see Phoenix.HTML.Form.datetime_local_input/3
for details.
Please see Phoenix.HTML.Form.datetime_select/3
for details.
Please see Phoenix.HTML.Form.email_input/3
for details.
Please see Phoenix.HTML.Form.file_input/3
for details.
Generates an empty form tag.
Generates a form tag with a form builder and a block.
Please see Phoenix.HTML.Form.hidden_input/3
for details.
Generate a new form builder for the given parameter in form.
Please see Phoenix.HTML.Form.multiple_select/4
for details.
Please see Phoenix.HTML.Form.number_input/3
for details.
Please see Phoenix.HTML.Form.password_input/3
for details.
Please see Phoenix.HTML.Form.label/2
for details.
Please see Phoenix.HTML.Form.label/3
for details.
Please see Phoenix.HTML.Form.label/4
for details.
Please see Phoenix.HTML.Form.range_input/3
for details.
Please see Phoenix.HTML.Form.reset/2
for details.
Please see Phoenix.HTML.Form.search_input/3
for details.
Please see Phoenix.HTML.Form.select/4
for details.
Please see Phoenix.HTML.Form.submit/1
for details.
Please see Phoenix.HTML.Form.submit/1
for details.
Please see Phoenix.HTML.Form.telephone_input/3
for details.
Please see Phoenix.HTML.Form.textarea/3
for details.
Please see Phoenix.HTML.Form.text_input/3
for details.
Please see Phoenix.HTML.Form.time_input/3
for details.
Please see Phoenix.HTML.Form.time_select/3
for details.
Please see Phoenix.HTML.Form.url_input/3
for details.
Link to this section Functions
checkbox(form, field, opts \\ []) View Source (macro)
Please see Phoenix.HTML.Form.checkbox/3
for details.
color_input(form, field, opts \\ []) View Source (macro)
Please see Phoenix.HTML.Form.color_input/3
for details.
date_input(form, field, opts \\ []) View Source (macro)
Please see Phoenix.HTML.Form.date_input/3
for details.
date_select(form, field, opts \\ []) View Source (macro)
Please see Phoenix.HTML.Form.date_select/3
for details.
datetime_local_input(form, field, opts \\ []) View Source (macro)
Please see Phoenix.HTML.Form.datetime_local_input/3
for details.
datetime_select(form, field, opts \\ []) View Source (macro)
Please see Phoenix.HTML.Form.datetime_select/3
for details.
email_input(form, field, opts \\ []) View Source (macro)
Please see Phoenix.HTML.Form.email_input/3
for details.
file_input(form, field, opts \\ []) View Source (macro)
Please see Phoenix.HTML.Form.file_input/3
for details.
form_for(form_data, action) View Source (macro)
Generates an empty form tag.
See Temple.Form.form_for/4
for more details
form_for(form_data, action, opts \\ [], block) View Source (macro)
Generates a form tag with a form builder and a block.
The form builder will be available inside the block through the form
variable.
This is a wrapper around the Phoenix.HTML.Form.form_for/4
function and accepts all of the same options.
Example
temple do
form_for @conn, Routes.some_path(@conn, :create) do
text_input form, :name
end
end
# {:safe,
# "<form accept-charset="UTF-8" action="/" method="post">
# <input name="_csrf_token" type="hidden" value="AS5qfX1gcns6eU56BlQgBlwCDgMlNgAAiJ0MR91Kh3v3bbCS5SKjuw==">
# <input name="_utf8" type="hidden" value="✓">
# <input id="name" name="name" type="text">
# </form>"}
inputs_for(form, field, options \\ [], list) View Source (macro)
Generate a new form builder for the given parameter in form.
The form builder will be available inside the block through the inner_form
variable.
This is a wrapper around the Phoenix.HTML.Form.inputs_for/4
function and accepts all of the same options.
Example
temple do
form_for @parent, Routes.some_path(@conn, :create) do
text_input form, :name
inputs_for form, :job do
text_input inner_form, :description
end
inputs_for form, :children do
text_input inner_form, :name
end
end
end
# {:safe,
# "<form accept-charset="UTF-8" action="/" method="post">
# <input name="_csrf_token" type="hidden" value="AS5qfX1gcns6eU56BlQgBlwCDgMlNgAAiJ0MR91Kh3v3bbCS5SKjuw==">
# <input name="_utf8" type="hidden" value="✓">
# <input id="name" name="parent[name]" type="text">
#
# <input id="name" name="parent[job][description]" type="text">
#
# <input id="name" name="parent[children][1][name]" type="text">
# <input id="name" name="parent[children][2][name]" type="text">
# </form>"}
multiple_select(form, field, options, attrs \\ []) View Source (macro)
Please see Phoenix.HTML.Form.multiple_select/4
for details.
number_input(form, field, opts \\ []) View Source (macro)
Please see Phoenix.HTML.Form.number_input/3
for details.
password_input(form, field, opts \\ []) View Source (macro)
Please see Phoenix.HTML.Form.password_input/3
for details.
phx_label(form, field) View Source (macro)
Please see Phoenix.HTML.Form.label/2
for details.
phx_label(form, field, text_or_opts) View Source (macro)
Please see Phoenix.HTML.Form.label/3
for details.
phx_label(form, field, opts, opts) View Source (macro)
Please see Phoenix.HTML.Form.label/4
for details.
range_input(form, field, opts \\ []) View Source (macro)
Please see Phoenix.HTML.Form.range_input/3
for details.
reset(value, opts \\ []) View Source (macro)
Please see Phoenix.HTML.Form.reset/2
for details.
search_input(form, field, opts \\ []) View Source (macro)
Please see Phoenix.HTML.Form.search_input/3
for details.
select(form, field, options, attrs \\ []) View Source (macro)
Please see Phoenix.HTML.Form.select/4
for details.
submit(value) View Source (macro)
Please see Phoenix.HTML.Form.submit/1
for details.
submit(opts, opts) View Source (macro)
Please see Phoenix.HTML.Form.submit/1
for details.
telephone_input(form, field, opts \\ []) View Source (macro)
Please see Phoenix.HTML.Form.telephone_input/3
for details.
text_area(form, field, opts \\ []) View Source (macro)
Please see Phoenix.HTML.Form.textarea/3
for details.
Note: Temple defines this function as text_area
with an underscore, whereas Phoenix.HTML defines it as textarea
without an underscore.
text_input(form, field, opts \\ []) View Source (macro)
Please see Phoenix.HTML.Form.text_input/3
for details.
time_input(form, field, opts \\ []) View Source (macro)
Please see Phoenix.HTML.Form.time_input/3
for details.
time_select(form, field, opts \\ []) View Source (macro)
Please see Phoenix.HTML.Form.time_select/3
for details.
url_input(form, field, opts \\ []) View Source (macro)
Please see Phoenix.HTML.Form.url_input/3
for details.