Forms
The ClearOS framework uses the standard functions from the CodeIgniter Form Helper for handling form open/close along with form fieldsets:
- form_open
- form_close
- form_fieldset
- form_fieldset_close
Form Open/Close
Functions
Function | Purpose |
---|---|
form_open(url, attributes = NULL) | Creating the opening |
form_close() | Creating the closing HTML element |
Parameters
url
The URL to post form button actions.
attributes (optional)
Optional HTML attributes to be passed to the button. We do not want to encourage using the options array, so please send us a quick note about why you need it.
Example
echo form_open('date'); echo form_fieldset(lang('date_time_and_date')); // some form fields and buttons go here echo form_fieldset_close(); echo form_close();
Fieldsets
Functions
Fieldsets are used to group various form fields together. For example, the user edit page has a fieldset for the address information, and a different fieldset for the various phone numbers. The purpose
Function | Purpose |
---|---|
form_fieldset(legend, attributes = NULL) | Generating |
form_fieldset_close() | Creating the closing HTML element |
Example
echo form_fieldset(lang('user_address')); // some address form fields echo form_fieldset_close(); echo form_fieldset(lang('user_telephone')); // some phone number form fields (work, mobile, home, yacht) echo form_fieldset_close();
The above example would generate the following HTML.
<fieldset> <legend>Address</legend> </fieldset> <fieldset> <legend>Telephone</legend> </fieldset>
Links
content/en_us/dev_framework_reference_guide_forms.txt · Last modified: 2015/02/05 19:47 (external edit)