"fields" variable
From Genitura
This page describes the components of the fields variable used for creating a form when creating a user object.
Contents |
General structure
'field_name' => array ('class'=>'Class', 'type'=>'Type', 'value'=>'default value')
field_name
This is the id and name of the field generated in the form. It must correspond to one of the model's fields so it can be stocked in the database. For this reason, submit buttons must not have the same name as one of the object's fields.
class
The field that is going to be initialized. The class can be Input, Select, Textarea, ...
type
The type of the field that is going to be initialized.
If the field's class is Input, the type can be:
- text
- password
- submit
- hidden
- ...
If the field's class is Select, the type can be any desired value, but must be referenced to in select_class.
If the field's class is Textarea, the type can be any desired value. The textarea generated will have a type class so it can be modified by JavaScript librairies.
value
This field is optional but is useful for naming submit-type Inputs, or for giving values to hidden fields.
