Public Member Functions | |
| __construct () | |
| add_button ($name, $label) | |
| add_checkbox ($name, $label='', $rules='') | |
| add_content ($content, $after=null) | |
| add_date_input ($name, $label='', $rules='') | |
| add_datetime_input ($name, $label='', $rules='') | |
| add_dropdown ($name, $label='', $rules='', $options=array()) | |
| add_field ($name, $label='', $rules='') | |
| add_group ($name, $fields=array()) | |
| add_hidden ($name, $value=null) | |
| add_input ($name, $label='', $rules='') | |
| add_password ($name, $label='', $rules='') | |
| add_radio_group ($name, $label='', $rules='') | |
| add_static ($name, $label='', $attrs=array()) | |
| add_submit ($name, $label) | |
| add_textarea ($name, $label='', $rules='') | |
| add_upload ($name, $label='') | |
| attr ($attrs=array(), $val=null) | |
| check ($field, $value=null) | |
| current_group ($grp=null) | |
| get_button ($name) | |
| get_datefields () | |
| get_field ($name) | |
| get_fieldnames () | |
| get_form () | |
| get_group ($name) | |
| get_post_data () | |
| jscal_date_format ($php_format) | |
| layout ($layout_model, $opt1='') | |
| m_set ($model, $fields=array()) | |
| render ($return_html=false) | |
| render_form_buttons () | |
| render_form_close () | |
| render_form_content () | |
| render_form_open ($attributes=array()) | |
| render_form_hidden () | |
| set_attr ($field_name, $attrs=array(), $value=null) | |
| add_field_class ($field_name, $cls) | |
| set_controller ($url) | |
| set_value ($fields='', $value='') | |
| unique_id ($id) | |
| validate () | |
| validation_errors ($prefix= '', $suffix= '') | |
| value ($field=null, $index=null) | |
Static Public Member Functions | |
| static | form_registry (&$form=null) |
| static | write_html_head () |
Public Attributes | |
| $controller = null | |
| The URL of the controller where this form should post to. | |
| $label_suffix = '' | |
| A string to append to labels (e.g. colon) | |
| $main_group = null | |
| The main group of fields. | |
| $contents = array() | |
| The form contents. | |
| $datefields = array() | |
| List of date field names. | |
| $date_format = 'Y-m-d' | |
| Format used for a date field. | |
| $datetime_format = 'Y-m-d g:i A' | |
| Format used for a datetime field. | |
Static Public Attributes | |
| static | $calendar_style = 'steel' |
| static | $calendar_alt_style = 'gold' |
Protected Attributes | |
| $attrs = array() | |
| Form attributes. | |
| $content_cnt = 1 | |
| Content counter to generate unique content-ids. | |
| $cur_group = null | |
| The current group. | |
| $data_fetched = false | |
| Flag to indicate whether POST data has been fetched. | |
| $fields = array() | |
| Flat list of all fields contained in this form. | |
| $has_upload = false | |
| Flag to indicate that the form contains a file-upload field. | |
| $submit_buttons = array() | |
| An array of submit buttons to appear at the bottom of the form. | |
| $input | |
| Handy reference to CI->input. | |
| $request_method | |
| The HTTP request method (GET or POST) currently in use. | |
| $CI | |
| CodeIgniter instance for subclasses that may want to use it. | |
| Qvcform::__construct | ( | ) |
Constructor
| Qvcform::add_button | ( | $name, | |
| $label | |||
| ) |
Add a button
| string | $name | |
| string | $label |
| Qvcform::add_checkbox | ( | $name, | |
$label = '', |
|||
$rules = '' |
|||
| ) |
Add a checkbox field
| string | $name | |
| string | $label | |
| string | $rules |
| Qvcform::add_content | ( | $content, | |
$after = null |
|||
| ) |
Add content to a form
| string | $content | |
| string | $after |
| Qvcform::add_date_input | ( | $name, | |
$label = '', |
|||
$rules = '' |
|||
| ) |
Add a date input field
| string | $name | |
| string | $label | |
| string | $rules |
| Qvcform::add_datetime_input | ( | $name, | |
$label = '', |
|||
$rules = '' |
|||
| ) |
Add a datetime input field
| string | $name | |
| string | $label | |
| string | $rules |
| Qvcform::add_dropdown | ( | $name, | |
$label = '', |
|||
$rules = '', |
|||
$options = array() |
|||
| ) |
Add a dropdown field
| string | $name | |
| string | $label | |
| string | $rules | |
| array | $options |
| Qvcform::add_field | ( | $name, | |
$label = '', |
|||
$rules = '' |
|||
| ) |
Add a generic field to the form
| string | $name | |
| string | $label | |
| string | $rules |
| Qvcform::add_field_class | ( | $field_name, | |
| $cls | |||
| ) |
Add a class (or classes) to a field
| string | $field_name | |
| array | string | $cls |
| Qvcform::add_group | ( | $name, | |
$fields = array() |
|||
| ) |
Add a group
| string | $name | |
| string[] | $fields |
| Qvcform::add_hidden | ( | $name, | |
$value = null |
|||
| ) |
Add a hidden field
| string | $name | |
| mixed | $value |
| Qvcform::add_input | ( | $name, | |
$label = '', |
|||
$rules = '' |
|||
| ) |
Add an input field
| string | $name | |
| string | $label | |
| string | $rules |
| Qvcform::add_password | ( | $name, | |
$label = '', |
|||
$rules = '' |
|||
| ) |
Add a password field
| string | $name | |
| string | $label | |
| string | $rules |
| Qvcform::add_radio_group | ( | $name, | |
$label = '', |
|||
$rules = '' |
|||
| ) |
Add a radio group field
| string | $name | |
| string | $label | |
| string | $rules |
| Qvcform::add_static | ( | $name, | |
$label = '', |
|||
$attrs = array() |
|||
| ) |
Add a static text field
| string | $name | |
| string | $label |
| Qvcform::add_submit | ( | $name, | |
| $label | |||
| ) |
Add a submit button
| string | $name | |
| string | $label |
| Qvcform::add_textarea | ( | $name, | |
$label = '', |
|||
$rules = '' |
|||
| ) |
Add a textarea field
| string | $name | |
| string | $label | |
| string | $rules |
| Qvcform::add_upload | ( | $name, | |
$label = '' |
|||
| ) |
Add a file upload field
| string | $name | |
| string | $label |
| Qvcform::attr | ( | $attrs = array(), |
|
$val = null |
|||
| ) |
Set attributes for a form
| array | string | $attrs | |
| string | $val |
| Qvcform::check | ( | $field, | |
$value = null |
|||
| ) |
Function used for setting the checked state for checkboxes. Returns true if the field value equals $val This function exists during the conversion from qvform to qvcform. It may not be required after the conversion is complete.
| str | $field | |
| str | $value |
| Qvcform::current_group | ( | $grp = null | ) |
Get/set the current group.
| object | $grp |
|
static |
The form registry exists so that the theme can find all the forms to do such things as initialize date fields.
| object | $form |
| Qvcform::get_button | ( | $name | ) |
Get a button object by name
| string | $name |
| Qvcform::get_field | ( | $name | ) |
Get a field object by name
| string | $name |
| Qvcform::get_fieldnames | ( | ) |
Get a list of field names that have been defined for this form.
| Qvcform::get_form | ( | ) |
Top of the chain for all form objects to get a pointer to the top-level form
| Qvcform::get_group | ( | $name | ) |
Find a group by name and return it
| string | $name |
| Qvcform::get_post_data | ( | ) |
Get the data from the corresponding $_POST array and cache it in the _field_data array. It is not necessary to call this function if you're using validate().
| Qvcform::jscal_date_format | ( | $php_format | ) |
Convert a date/datetime format string from php format to jscal format
| string | $php_format |
| Qvcform::layout | ( | $layout_model, | |
$opt1 = '' |
|||
| ) |
Set the layout model for rendering
| string | $layout_model | |
| string | $opt1 |
| Qvcform::m_set | ( | $model, | |
$fields = array() |
|||
| ) |
Set a list of fields from a model
| object | $model | |
| array | $fields | - optional; if not set then will use all fields |
| Qvcform::render | ( | $return_html = false | ) |
Render the form and all its fields
| Qvcform::render_form_buttons | ( | ) |
Render the form buttons
| Qvcform::render_form_close | ( | ) |
Call CI form_close() Sure, seems redundant, but makes this complete.
| Qvcform::render_form_hidden | ( | ) |
Print the hidden fields associated with this form.
| Qvcform::render_form_open | ( | $attributes = array() | ) |
Call CI form_open() and print the hidden fields. This function is intended to support full-custom views that do their own rendering.
| array | $attributes | An optional array containing attributes |
| Qvcform::set_attr | ( | $field_name, | |
$attrs = array(), |
|||
$value = null |
|||
| ) |
Set a field attribute
| string | $field_name | |
| array | string | $attrs | |
| mixed | $value |
| Qvcform::set_controller | ( | $url | ) |
Set the URL of the form controller
| string | $url |
| Qvcform::set_value | ( | $fields = '', |
|
$value = '' |
|||
| ) |
Set the value of a field or fields. Also used to initialize/establish fields.
| mixed | $fields | |
| mixed | $value |
| Qvcform::unique_id | ( | $id | ) |
Return an ID string that is unique to this form
| string | $id |
| Qvcform::validate | ( | ) |
Run form validation
| Qvcform::validation_errors | ( | $prefix = '', |
|
$suffix = '' |
|||
| ) |
Return validation errors
| string | $prefix | |
| string | $suffix |
| Qvcform::value | ( | $field = null, |
|
$index = null |
|||
| ) |
Return the current value of a field. Justification: Why don't we use this function to set a value? Because we need the second parameter to be and index to allow easy retrieval from arrays. The advantage of doing it this way is that the caller does not need to be concerned about whether that index is actually set. Otherwise it would have to test to see if it is set first.
| string | array | $field | |
| int | $index |
|
static |
Write the required statements for the <head> section that are required for qvcform support.
1.8.5