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. | |
Define the form field class
| fm_field::__construct | ( | $parent, | |
| $data | |||
| ) |
Constructor
| array | string | $data |
| fm_field::add_class | ( | $cls | ) |
Add a class (or classes) to a field
| array | string | $cls |
| fm_field::add_control_prefix | ( | $str | ) |
| fm_field::add_control_suffix | ( | $str | ) |
| fm_field::add_to_group | ( | $groupname | ) |
Add this field to a group
| string | $groupname |
| fm_field::attr | ( | $attrs = array(), |
|
$val = null |
|||
| ) |
Set attributes for a form field
| array | string | $attrs | |
| string | $val |
| fm_field::get_control | ( | $opt = array() | ) |
Create a form control and return the html 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.
| string | $pos |
| fm_field::label_suffix | ( | $suffix | ) |
Set the label suffix.
| 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.
| string | $name | |
| array | $options | |
| array | $selected | |
| string | $extra |
| fm_field::options | ( | $opts = array() | ) |
| 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.
| string | $val |
| fm_field::style | ( | $s | ) |
| fm_field::value | ( | $val = null | ) |
| fm_field::write_jscal_setup | ( | ) |
Function to write javascript calendar setup function. This only applies to date input fields.
1.8.5