QVCI Library 3.1
 All Classes Namespaces Functions Variables
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Attributes | List of all members
Qvcform Class Reference
Inheritance diagram for Qvcform:

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.
 

Constructor & Destructor Documentation

Qvcform::__construct ( )

Constructor

Member Function Documentation

Qvcform::add_button (   $name,
  $label 
)

Add a button

Parameters
string$name
string$label
Qvcform::add_checkbox (   $name,
  $label = '',
  $rules = '' 
)

Add a checkbox field

Parameters
string$name
string$label
string$rules
Qvcform::add_content (   $content,
  $after = null 
)

Add content to a form

Parameters
string$content
string$after
Qvcform::add_date_input (   $name,
  $label = '',
  $rules = '' 
)

Add a date input field

Parameters
string$name
string$label
string$rules
Qvcform::add_datetime_input (   $name,
  $label = '',
  $rules = '' 
)

Add a datetime input field

Parameters
string$name
string$label
string$rules
Qvcform::add_dropdown (   $name,
  $label = '',
  $rules = '',
  $options = array() 
)

Add a dropdown field

Parameters
string$name
string$label
string$rules
array$options
Qvcform::add_field (   $name,
  $label = '',
  $rules = '' 
)

Add a generic field to the form

Parameters
string$name
string$label
string$rules
Qvcform::add_field_class (   $field_name,
  $cls 
)

Add a class (or classes) to a field

Parameters
string$field_name
array | string$cls
Qvcform::add_group (   $name,
  $fields = array() 
)

Add a group

Parameters
string$name
string[]$fields
Qvcform::add_hidden (   $name,
  $value = null 
)

Add a hidden field

Parameters
string$name
mixed$value
Qvcform::add_input (   $name,
  $label = '',
  $rules = '' 
)

Add an input field

Parameters
string$name
string$label
string$rules
Qvcform::add_password (   $name,
  $label = '',
  $rules = '' 
)

Add a password field

Parameters
string$name
string$label
string$rules
Qvcform::add_radio_group (   $name,
  $label = '',
  $rules = '' 
)

Add a radio group field

Parameters
string$name
string$label
string$rules
Qvcform::add_static (   $name,
  $label = '',
  $attrs = array() 
)

Add a static text field

Parameters
string$name
string$label
Qvcform::add_submit (   $name,
  $label 
)

Add a submit button

Parameters
string$name
string$label
Qvcform::add_textarea (   $name,
  $label = '',
  $rules = '' 
)

Add a textarea field

Parameters
string$name
string$label
string$rules
Qvcform::add_upload (   $name,
  $label = '' 
)

Add a file upload field

Parameters
string$name
string$label
Qvcform::attr (   $attrs = array(),
  $val = null 
)

Set attributes for a form

Parameters
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.

Parameters
str$field
str$value
Qvcform::current_group (   $grp = null)

Get/set the current group.

Parameters
object$grp
static Qvcform::form_registry ( $form = null)
static

The form registry exists so that the theme can find all the forms to do such things as initialize date fields.

Parameters
object$form
Returns
object[]
Qvcform::get_button (   $name)

Get a button object by name

Parameters
string$name
Qvcform::get_field (   $name)

Get a field object by name

Parameters
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

Parameters
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

Parameters
string$php_format
Returns
string
Qvcform::layout (   $layout_model,
  $opt1 = '' 
)

Set the layout model for rendering

Parameters
string$layout_model
string$opt1
Qvcform::m_set (   $model,
  $fields = array() 
)

Set a list of fields from a model

Parameters
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.

Parameters
array$attributesAn optional array containing attributes
Qvcform::set_attr (   $field_name,
  $attrs = array(),
  $value = null 
)

Set a field attribute

Parameters
string$field_name
array | string$attrs
mixed$value
Qvcform::set_controller (   $url)

Set the URL of the form controller

Parameters
string$url
Qvcform::set_value (   $fields = '',
  $value = '' 
)

Set the value of a field or fields. Also used to initialize/establish fields.

Parameters
mixed$fields
mixed$value
Qvcform::unique_id (   $id)

Return an ID string that is unique to this form

Parameters
string$id
Qvcform::validate ( )

Run form validation

Qvcform::validation_errors (   $prefix = '',
  $suffix = '' 
)

Return validation errors

Parameters
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.

Parameters
string | array$field
int$index
static Qvcform::write_html_head ( )
static

Write the required statements for the <head> section that are required for qvcform support.


The documentation for this class was generated from the following file: