|
Agile Toolkit
4.2
Agile Toolkit is a powerful web development framework. Inspired by GUI Applications development
|
Public Member Functions | |
| setActualFields ($fields) | |
| importFields ($model, $fields=undefined) | |
| importField ($field) | |
| setFields () | |
| getFields () | |
| getFieldType ($field) | |
| update ($form) | |
Data Fields | |
| $model = null | |
| $form = null | |
| $field_associations = array() | |
| $type_associations | |
| getFields | ( | ) |
| getFieldType | ( | $ | field | ) |
Redefine this to add special handling of your own fields
| importField | ( | $ | field | ) |
| importFields | ( | $ | model, |
| $ | fields = undefined |
||
| ) |
| setActualFields | ( | $ | fields | ) |
| setFields | ( | ) |
Copies model field values into form
| update | ( | $ | form | ) |
| $field_associations = array() |
| $form = null |
| $model = null |
Connects regular form with a model and imports some fields. It also binds action on form->update(), which will now force model to be updated.
In most cases the following use is sufficient $form->setModel('SomeModel');
If you want to import fields from multiple models, you can use this: $ctl = $form->importFields($model,array('name','surname');
and if you want to use your own class based on this one, syntax is: $ctl = $form->add('Controller_MVCForm_Derived')->importFields($model,array('name','surname'));
You can subsequently call importField() to add additional fields such as:
$form_field = $ctl->importField('age');
which will return newly added form field.
Reimplemented from AbstractObject.
| $type_associations |
array(
'string'=>'line',
'text'=>'text',
'int'=>'line',
'numeric'=>'line',
'money'=>'line',
'real'=>'line',
'date'=>'DatePicker',
'datetime'=>'DatePicker',
'daytime'=>'timepickr',
'boolean'=>'checkbox',
'reference'=>'readonly',
'reference_id'=>'reference',
'password'=>'password',
'list'=>'reference',
'radio'=>'Radio',
'readonly'=>'readonly',
'image'=>'image',
'file'=>'upload',
)