Ferreteria/v2/usage/forms: Difference between revisions
< Ferreteria | v2 | usage
Jump to navigation
Jump to search
(significant functions; version 2 imminent) |
(some v2 documentation) |
||
Line 4: | Line 4: | ||
* '''field''' classes handle translating values between internal storage and on-disk storage (database) | * '''field''' classes handle translating values between internal storage and on-disk storage (database) | ||
Forms are | The Forms classes are being rewritten from scratch; this page applies to the new version (2). Version 1 is [[/v1|here]]. | ||
{| width=100% | {| width=100% | ||
| valign=top bgcolor=#efe | | | valign=top bgcolor=#efe | | ||
==Files== | ==Files== | ||
* {{ferreteria/code| | * {{ferreteria/code|forms/ctrl.php}} | ||
** ''' | ** '''fcFormControl''' (abstract) | ||
*** '''fcFormControl_HTML''' ← fcFormControl | |||
**** '''fcFormControl_HTML_TextArea''' ← fcFormControl_HTML | |||
* {{ferreteria/code|forms/field.php}} | |||
** '''fcFormField''' | |||
*** '''fcFormField_Num''' ← fcFormField | |||
*** '''fcFormField_Time''' ← fcFormField | |||
* {{ferreteria/code|forms/form.php}} | |||
*** ''' | ** '''fcForm''' (abstract) | ||
**** ''' | *** '''fcForm_keyed''' ← fcForm | ||
* | * {{ferreteria/code|forms/form-data.php}} | ||
** '''fcForm_DB''' ← fcForm_keyed | |||
* | |||
* {{ferreteria/code|form-data.php}} | |||
| valign=top bgcolor=#eef | | | valign=top bgcolor=#eef | | ||
==Classes== | ==Classes== | ||
* '''fcForm''' (abstract) | |||
** '''fcForm_keyed''' ← fcForm | |||
* ''' | *** '''fcForm_DB''' ← fcForm_keyed | ||
** ''' | * '''fcFormField''' | ||
*** ''' | ** '''fcFormField_Num''' ← fcFormField | ||
** '''fcFormField_Time''' ← fcFormField | |||
* '''fcFormControl''' (abstract) | |||
* ''' | ** '''fcFormControl_HTML''' ← fcFormControl | ||
** ''' | *** '''fcFormControl_HTML_TextArea''' ← fcFormControl_HTML | ||
** ''' | |||
* ''' | |||
** ''' | |||
*** ''' | |||
|} | |} | ||
==Significant Functions== | ==Significant Functions== | ||
* | * '''fcForm''' | ||
** | ** ControlArray({{arg|array of control objects (optional)}}) - set/get all control objects | ||
** | ** ControlObject({{arg|name}},{{arg|control object (optional)}}) - set/get control object for given name | ||
* | ** AddField({{arg|field object}}, {{arg|control object}}) | ||
** | ** LoadRecord() (abstract) | ||
** | ** SaveRecord() (abstract) | ||
** RecordValue({{arg|name}},{{arg|value (optional)}}) - set/get field value | |||
** | ** RecordValues({{arg|array of values (optional)}}) - set/get all field values | ||
* | ** NewValues({{arg|array of values (optional)}}) - set/get values for new records | ||
* | ** ClearValues() | ||
** | ** RenderControls({{arg|edit?}}) | ||
* | |||
* |
Revision as of 15:05, 5 April 2015
About
Forms in Ferreteria consist of several sets of classes that work together:
- control classes render editable (and eventually non-editable) data fields
- field classes handle translating values between internal storage and on-disk storage (database)
The Forms classes are being rewritten from scratch; this page applies to the new version (2). Version 1 is here.
Files
|
Classes
|
Significant Functions
- fcForm
- ControlArray(<array of control objects (optional)>) - set/get all control objects
- ControlObject(<name>,<control object (optional)>) - set/get control object for given name
- AddField(<field object>, <control object>)
- LoadRecord() (abstract)
- SaveRecord() (abstract)
- RecordValue(<name>,<value (optional)>) - set/get field value
- RecordValues(<array of values (optional)>) - set/get all field values
- NewValues(<array of values (optional)>) - set/get values for new records
- ClearValues()
- RenderControls(<edit?>)