QVCI Library 3.1
 All Classes Namespaces Functions Variables
Public Member Functions | Public Attributes | Protected Attributes | List of all members
fm_field Class Reference

Public Member Functions

 __construct ($parent, $data)
 
 add_class ($cls)
 
 add_control_prefix ($str)
 
 add_control_suffix ($str)
 
 add_to_group ($groupname)
 
 attr ($attrs=array(), $val=null)
 
 get_control ($opt=array())
 
 get_form ()
 
 get_label ($attrs=array())
 
 label_position ($pos)
 
 label_suffix ($suffix)
 
 make_static ()
 
 my_form_dropdown ($name= '', $options=array(), $selected=array(), $extra= '')
 
 options ($opts=array())
 
 set_value ($val=null)
 
 style ($s)
 
 value ($val=null)
 
 write_jscal_setup ()
 

Public Attributes

 $attrs = array()
 Field-specific attributes.
 
 $opts = array()
 Selector options.
 
 $name = null
 Field name.
 
 $label = null
 Field label.
 
 $type = 'text'
 Input type.
 
 $parent = null
 The parent oblect.
 
 $classes = array()
 HTML classes.
 
 $label_pos = 'before'
 The position of the field label.
 
 $label_suffix = null
 Text to place after label; if NULL then use the form setting.
 
 $styl = null
 HTML style.
 
 $chkbox_value = 1
 The value to use when the field is a checkbox.
 

Protected Attributes

 $is_static = false
 Render input control as static (readonly) text.
 
 $control_prefix = ''
 String to appear before the control.
 
 $control_suffix = ''
 String to appear after the control.
 

Detailed Description

Define the form field class

Constructor & Destructor Documentation

fm_field::__construct (   $parent,
  $data 
)

Constructor

Parameters
array | string$data

Member Function Documentation

fm_field::add_class (   $cls)

Add a class (or classes) to a field

Parameters
array | string$cls
fm_field::add_control_prefix (   $str)

Add a prefix to a control

Parameters
string$str
Returns
fm_field
fm_field::add_control_suffix (   $str)

Add a suffix to a control

Parameters
string$str
Returns
fm_field
fm_field::add_to_group (   $groupname)

Add this field to a group

Parameters
string$groupname
fm_field::attr (   $attrs = array(),
  $val = null 
)

Set attributes for a form field

Parameters
array | string$attrs
string$val
fm_field::get_control (   $opt = array())

Create a form control and return the html string

Returns
string
fm_field::get_form ( )

Get the top-level form object

fm_field::get_label (   $attrs = array())

Return the label for this form field

fm_field::label_position (   $pos)

Set the label position.

Parameters
string$pos
fm_field::label_suffix (   $suffix)

Set the label suffix.

Parameters
string$suffix
fm_field::make_static ( )

Make an input control static. This will reset any rules which have been defined.

fm_field::my_form_dropdown (   $name = '',
  $options = array(),
  $selected = array(),
  $extra = '' 
)

My version of the CodeIgniter form_dropdown, which allows separators between the items. To include a separator, simply add an option that contains nothing but dashes. Each dash will be converted to an emdash, and the option itself will be disabled.

Parameters
string$name
array$options
array$selected
string$extra
Returns
string
fm_field::options (   $opts = array())

Set selector/dropdown options

Parameters
array$opts
Returns
fm_field
fm_field::set_value (   $val = null)

Alias function to set a value. Provided for consistency with qvcform, which also uses set_value(), but this one also allows chaining.

Parameters
string$val
Returns
fm_field
fm_field::style (   $s)

Add a style string

Parameters
unknown$s
Returns
fm_field
fm_field::value (   $val = null)

Get the current value, and optionally set a new value

Parameters
string$val
Returns
fm_field
fm_field::write_jscal_setup ( )

Function to write javascript calendar setup function. This only applies to date input fields.


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