
bootstrap.pl -- Bootstrap form generator
This library provides HTML rules for constructing Bootstrap forms.
bt_form(+Contents, +Options)//- Emit a Bootstrap form from Contents. Each element of Contents is
one of the following terms:
input(Name, Type, InputOptions)
select(Name, Values, SelectOptions)
checkboxes(Name, Values, BoxOptions)
button(Name, Type, ButtonOptions)
button_group(Buttons, GroupOptions)
hidden(Name, Value)
Options processed:
- class(+Class)
- One of 'form-inline' or 'form-horizontal'. Default is a vertical
form.
- label_columns(+SizeCount)
- Number of columns of the grid to use for the label. In use for
'form-horizontal'. Default is sm-2 (a pair)
form_style(+Style, +Options)[private]
bt_form_element(+Term, +Options)//[private]- Add a single element to the form.
bt_label(+Name, +ElementOptions, +FormsOptions)//[private]- Emit a label.
bt_input(+Name, +Type, +InputOptions, +FormOptions)//[private]- Emit an input element. InputOptions are:
- value(+Value)
- Initial value of the input
- disabled(+Boolean)
- If
true
, the input is inactive.
- readonly(+Boolean)
- If
true
, the input cannot be edited.
bt_select(+Name, +Values, +SelectOptions, +FormOptions)//[private]- Emit a <select> element. SelectOptions:
- value(Value)
- If present, provides the preselected value
- size(Size)
- Provides the number of visible options.
bt_checkboxes(+Name, +Values, +SelectOptions, +FormOptions)//[private]- Set of checkboxes reported as an array that is a subset of Values.
bt_textarea(+Name, +TextAreaOptions, +FormOptions)//[private]
bt_button_group(+Buttons, +ButtonOptions, +FormOptions)//[private]- Emit a div for a group of buttons.
bt_button(+Name, +Type, +ButtonOptions, +FormOptions)//
button_classes(+ElemOptions, +FormOptions)//[private]- Collect the classes from element and form options
data(+Options)//[private]- Collect data options.
classes(+Options)//[private]- Collect defined classes
name_label(+Name, -Label) is det- Determine a label from a name by upcasing the first character and
replacing all underscores by spaces.